106-19-guruh talabasi Hamroyev Dilshodning algoritmni loyihalash fanidan
9-labaratoriya ishi.
#include
#include
using namespace std;
int main()
{ int n,i; cin>>n;
float x[20],y[20],a,b1,b0,s1=0,s2=0,s3=0,s4=0;
for(i=1;i<=n;i++){
cin>>x[i]>>y[i];
}
for(i=1;i<=n;i++){
s1+=pow(x[i],2);
s2+=y[i];
s3+=x[i];
s4+=y[i]*x[i];
}
b0=(s1*s2-s3*s4)*1.0/(n*s1-pow(s3,2));
b1=(n*s4-s2*s3)*1.0/(n*s1-pow(s3,2));
cout<<"so`ralayotgan nuqtani kiriting x=";cin>>a;
cout<<"so`ralayotgan nuqtada funksiya y="<return 0;
}
Do'stlaringiz bilan baham: |