int a,n,i=1,s=0,t=0; printf(\请输入两个正整数a,n=:\\n\ scanf(\ while(i<=n){ t=t+a; s=s+t; a=a*10; ++i; } printf(\\\n\} 7、
#include\void main() { int i,j,k,l,n; printf(\之间的水仙花数有:\\n\ for(n=10;n<10000;n++) { i=n/1000; j=n/100; k=n/10; l=n; if(i*1000+j*100+k*10+l==i*i*i+j*j*j+k*k*k+l*l*l) { printf(\ } } printf(\} 9、
#include\#include\void main() { int i,n,m,j,k; i=0; printf(\请输入一个多位整数:\\n\ scanf(\ k=n; while(k!=0) { i++;
k=k/10; } k=n; m=pow(10,i-1); printf(\逐位输出:%d\ printf(\ for(j=m/10;j>0;j=j/10) { n=k/j; printf(\ if(j!=1) printf(\ } } 11、
#include\void main() { int p,r,n,m,temp; printf(\请输入两个正整数:\\n\ scanf(\ if(n #include\void main() { int i,j; for(i=0;i<=3;i++){ } for(j=0;j<=2-i;j++) printf(\ for(j=0;j<=2*i;j++) printf(\ printf(\} for(i=0;i<=2;i++){ for(j=0;j<=i;j++) printf(\ for(j=0;j<=4-2*i;j++) printf(\ printf(\} 第五章 1. #include sum=(long)(pow(10,n-1)*a)+fac(n-1,a); return(sum); } main() { int a,n,i; long temp,sum=0; printf(\请输入一个数a,n\\n\ scanf(\ for(i=1;i<=n;i++) { temp=fac(i,a); sum+=temp; } printf(\它们的和是=%ld\ return 0; } 2. #include int countdight(int number,int dight); int main(void) { int number; printf(\输入一个数:\ scanf(\ countdight(number,2); return 0; } countdight(int number,int dight) { int a,count; count=0; while(number!=0) { a=number; number=number/10; if(a==dight) count++; } printf(\ return count; } 3. #include return 0; } int fib(int n) { int i,x1,x2,x,t; x1=1; x2=1; for(i=0;i #include void is(int num) { int i,j,k; for(num=1;num<1000;num++) { i=num/100; j=num/10; k=num; if(i*100+j*10+k*1==i*i*i+j*j*j+k*k*k)