السلام عليكم
هذي مساله حاولت احله بس ما عرفت لها
حاولت فيها اتمنى احد يشوف وين الخطا
والمساله في المرفق
اول شي ما عرفت كيف اعبر عن المعادلة المعطاه
ومحاولتي هنا
#include<iostream>
#include<fstream>
#include<cmath>
using namespace std;
int main()
{
int n;
int x;
float mean;
float s_d;
float sum;
ifstream infile;
infile.open("scores.dat");
if (!infile)
{
cout<<"can't open input file"<<endl;
return 1;
}
x=1;
n=0;
while (n);
{
infile>>x>>endl;
n++;
}
if(!infile)
{
if(n==0)
cout<<" there is no numbers in the file!?"<<endl;
else
{
mean=sum/n;
cout<<" mean= "<<mean<<endl;
s_d=sqrt(((n)sqrt(x)-((x)(x))/n(n-1));
cout<<"standard deviation = "<<s_d<<endl;
return 1;
}
}
infile.close();
return 0;
}