#includeint main() { int i,j; //i控制行,j控制列 for(i=1;i<=9;i++) { for(j=1;j<=i;j++) { printf("%d*%d=%-4d",j,i,i*j); //加负号是左对齐 } printf("n"); } return 0; }
#include#define IN 1 //在单词内 #define OUT 0 //在单词外 int main() //统计输入的行数、单词数与字符数 { int c,nl,nw,nc,state; state = OUT; nl = nw = nc = 0; while((c = getchar())!=EOF) { ++nc; if(c == 'n') ++nl; if(c == ' '||c == 'n'||c == 't') state = OUT; else if(state == OUT) { state = IN; ++nw; } } printf("%d %d %dn",nl,nw,nc); return 0; }
#includeint main() { int n,i,first=1,d,sum,j,p,t; scanf("%d",&n); for(i=1;i 0) { d=t%10; t=t/10; p=1; for(j=1;j<=n;j++) p *= d; sum += p; } if(sum==i) printf("%dn",i); } return 0; }
#includeint main() { int m,n,i,j,flag,sum=0,cnt=0; scanf("%d %d",&m,&n); for(i=m;i<=n;i++) { flag=1; for(j=2;j 欢迎分享,转载请注明来源:内存溢出
评论列表(0条)