Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» Celebrity.Sex.Tape.UNCUT.&.UNRATED.2012.720p.BRrip.x264.YIFY.mp4
Tue Dec 17, 2013 8:32 am by titquarra

» Maya Autodesk Personal Learning Edition 8.5
Tue Dec 17, 2013 7:47 am by titquarra

» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

Shopmotion


Affiliates
free forum


Nội suy Lagrange

View previous topic View next topic Go down

Nội suy Lagrange

Post  Admin on Thu Jun 09, 2011 3:04 am

//Noi suy Lagrange
http://Noisuy.cpp
#include <conio.h>
#include <iostream.h>
#define N 100

class BANGSO
{
private:
float x***91;N***93;;
float y***91;N***93;;
int n;
public:
void nhap_so_lieu();
void noi_suy(float);
};

void BANGSO::nhap_so_lieu()
{
cout << "So moc noi suy:";
cin >> n;
while (n>N)
{
cout <<"So ban nhap qua lon!Hay nhap so khac:";
cin >> n;
}

cout <<"Bat dau nhap so lieu vao bang!"<<endl;
getch();

for (int i=0;i<=n-1;i++)
{
cout <<'x' << i<<'=';
cin >>x***91;i***93;;

cout << 'y' << i << '=';
cin >> y***91;i***93;;
}
cout << "Da nhap xong so lieu vao bang!" << endl;
getch();

}

void BANGSO::noi_suy(float c)
{
float l***91;N***93;;
for (int i=0;i<=n-1;i++)
{
l***91;i***93;=1;
for (int j=0;j<=n-1;j++)
{
if (i==j)
continue;
else
l***91;i***93;*=(c-x***91;j***93;)/(x***91;i***93;-x***91;j***93;);
}
}

float kq=0;
for (i=0;i<=n-1;i++)
{
kq+=y***91;i***93;*l***91;i***93;;
}

cout << "KQ: " << kq;
getch();
}

void main()
{
float c;
BANGSO bang1;
clrscr();
bang1.nhap_so_lieu();
cout<<"nhap c=";
cin >>c;
bang1.noi_suy(c);
getch();
}

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum