怎么能每行输出八个数呢?
程序代码:
#include<stdio.h> int main(){ int m,n,count; for(m=1000;m<=20000;m++){ n=m; count=0; while(n){ if(n%10==9) count++; n/=10; } if(count==3) printf("%d ",m); } }
#include<stdio.h> int main(){ int m,n,count; for(m=1000;m<=20000;m++){ n=m; count=0; while(n){ if(n%10==9) count++; n/=10; } if(count==3) printf("%d ",m); } }