#include<stdio.h> int main() { int i = 0,j,k,n,s; char ch; scanf("%d",&n); //输入有几组数据。 while(scanf("%c %d",&ch,&s) != EOF) { i ++; //printf("i = %d\n",i); //printf("n = %d,i == %d\n",n,i); //scanf("%c %d",&ch,&s); scanf("%c",&ch); //输入打印三角形要用的字符 scanf("%d",&s); //输入三角形的规模 for(j = 1;j <= s;j++) { if(j == s) { for(k = 1;k<= s*2-1;k++) { printf("%c",ch); } //printf("\n"); //break; } else if(j == 1) { /* Main.c: In function ‘main’: Main.c:27:4: error: expected declaration or statement at end of input { ^ Main.c:27:4: error: expected declaration or statement at end of input Main.c:27:4: error: expected declaration or statement at end of input Main.c:27:4: error: expected declaration or statement at end of input */ |
Double click to view unformatted code.