Documents
Resources
Learning Center
Upload
Plans & pricing Sign in
Sign Out

22

VIEWS: 26 PAGES: 1

									#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(); }


								
To top