解题思路:
主要是理解题意。
注意事项:
题目是输入一个然后输出一个,而不是一次性全部输入,再输出。
参考代码:
/*字符串的输入输出处理*/ #include"stdio.h" #include"string.h" int main() { int N; char ch[1001]; int i,j=1; scanf("%d",&N); getchar(); //接收回车符// while(gets(ch)!=NULL) { if(j<=N) printf("%s\n\n",ch); else { for(i=0;i<strlen(ch);i++) { if(ch[i]==' ') printf("\n\n"); else printf("%c",ch[i]); } printf("\n\n"); } j++; } return 0; }
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题10.5 (C语言代码)浏览:1450 |
【亲和数】 (C语言代码)浏览:860 |
WU-蓝桥杯算法提高VIP-交换Easy (C++代码)浏览:1119 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:594 |
简单的a+b (C语言代码)浏览:817 |
1014题解浏览:485 |
字符逆序 (C语言代码)浏览:621 |
整除问题 (C语言代码)浏览:526 |
C二级辅导-等差数列 (C语言代码)浏览:826 |
简单的a+b (C语言代码)浏览:416 |