Chiadathuc_daisodaicuong

  • Uploaded by: bui ong tuyen
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Chiadathuc_daisodaicuong as PDF for free.

More details

  • Words: 216
  • Pages: 2
#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"