欢迎来到天天文库
浏览记录
ID:38152738
大小:97.60 KB
页数:4页
时间:2019-05-29
《c语言-输出质数数组和质数的个数》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#includeenumdivisor{Two=2,Three=3,Five=5,Seven=7};unsignedintvalue,Conting=0;unsignedintminorr[50],mas[50],saifice[50],suffi[50];enumdivisorDvisor=Two;voidianc(void);//endingdelcarationintmain(){ianc();intj=0,k=0;for(j=0;minorr[j]!=0;j++){if((minorr[j]%Dvisor)!=0
2、
3、(minorr[j]==Dvi
4、sor)){printf("%d",minorr[j]);mas[k]=minorr[j];k=k+1;}}k=0;printf("");Dvisor=Five;for(j=0;mas[j]!=0;j++){if((mas[j]%Dvisor)!=0
5、
6、(mas[j]==Dvisor)){printf("%d",mas[j]);saifice[k]=mas[j];k=k+1;}}printf("");Dvisor=Seven;k=0;for(j=0;saifice[j]!=0;j++){if((saifice[j]%Dvisor)!=0
7、
8、(saifice[j]=
9、=Dvisor)){printf("%d",saifice[j]);suffi[k]=saifice[j];k=k+1;}}printf("ThrF%d",suffi[13]);printf("thevalueofjis%d",j);printf("thevalueofkis%d",k);while(1);}voidianc(void){inti;for(i=2;i<=80;i++){if(((i%Dvisor)!=0)
10、
11、(i==2)){value++;minorr[Conting]=i;printf("%d",minorr[Conting]);Contin
12、g++;}}Dvisor=Three;printf("");i=0;}
此文档下载收益归作者所有