22

Document Sample
22 Powered By Docstoc
					#include<fstream.h> void main() {ifstream f("pol.in"); int gr,coefpol[100],coefmon,grmon,coefcat[100],coefrest[100]; f>>grad; for(int i=1;i<=gr+1;i++)f>>coefpol[i]; f>>grmon; f>>coefmon; for(i=1;i<=gr-gradmon+1;i++)coefcat[i]=coefpol[i]/coefmon; for(int j=1;j<=grmon;j++)coefrest[j]=coefpol[j+gr-grmon+1]; ofstream fo("pol.out"); fo<<"catul este "<<endl; for(i=1;i<=gr-grmon+1;i++)fo<<coefcat[i]<<" X^ "<<gr-grmon-i+1<<endl; fo<<"restul este "<<endl; for(i=1;i<=grmon;i++)fo<<coefrest[i]<<" X^ "<<grmon-i<<endl; getch(); }


				
DOCUMENT INFO
Shared By:
Tags:
Stats:
views:26
posted:10/30/2008
language:
pages:1
Olanescu Ana Maria Olanescu Ana Maria
About