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

22

VIEWS: 37 PAGES: 1

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


								
To top