|
5#
楼主 |
发表于 2014-4-20 23:32:54
|
只看该作者
本帖最后由 rosynirvana 于 2014-4-21 00:27 编辑
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- printf("A\n");
- printf("BC\n");
- printf("DEF\n");
- printf("GHIJ\n");
- printf("KLMNO\n");
- printf("PRSTUV\n");
- printf("W\n");
- printf("X\n");
- printf("Y\n");
- printf("Z\n");
- system("pause");
- return 0;
- }
复制代码
更熟练一点的写法
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int ch = 'A';
- int i, j;
- for(i=1; i<=5; ++i){
- for(j=1; j<=i; ++j)
- putchar(ch++);
- puts("");
- }
- puts("PRSTUV");
- for(ch = 'W'; ch <= 'Z'; ++ch)
- printf("%c\n", ch);
- system("pause");
- return 0;
- }
复制代码 |
|