#include int nd(int a,int b,int c) { int dem=0,bay=0; while(bay!=1) { dem++; if(dem*b%c==a) { bay=1; } } return dem;
} int nhan(int a,int b,int c) { return a*b%c; } void main() { int truong; cout<<"nhap vao so nguyen to n"<<endl; cin>>truong; cout<<" Thuc hien phep chia da thuc tren Z/"<<truong<<"Z"<<endl; int dem1=0; int bac1,bac2; int bac3=1; cout<<"nhap vao bac cua da thuc chia:?"<<endl; cin>>bac1; float hs1[100]; float hs2[100]; float hs3[100]; float hs4[100]; for(int j=0;j<100;j++) { hs1[j]=0; hs2[j]=0; hs3[j]=0; hs4[j]=0; } cout<<"Nhap vao cac he so cua da thuc chia: ?"<<endl; for(int i=0;i<=bac1;i++) { cout<<"he so cua X^"<>hs1[i]; if(hs1[i]<0) { hs1[i]=truong+hs1[i]; } } cout<<"nhap vao bac cua da thuc bi chia: ?"<<endl; cin>>bac2; cout<<"Nhap vao cac he so cua da thuc bi chia: ?"<<endl; for(i=0;i<=bac2;i++) { cout<<"he so cua X^"<>hs2[i];
}
if(hs2[i]<0) { hs2[i]=truong+hs2[i]; }
cout<<" Ket Qua:"<<endl; if(bac1
} cout<<endl; cout<<"he so cua da thuc du la =:"; for(i=0;i
More Documents from "bui ong tuyen"