解题思路:
定义了一个数组,输出除空格之外的所有字符
参考代码:
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i=0,j=0; char p[1001]={0}; for(i=0;i<3;i++){ gets(p); if(strlen(p)>101){ printf("Result String is cutted.\n"); }else{ for(j=0;j<strlen(p);j++){ if(p[j]!=' '){ putchar(p[j]); } } printf("\n"); } } return 0; }
0.0分
156 人评分
简单的a+b (C++语言代码)浏览:889 |
C语言程序设计教程(第三版)课后习题5.5 (C语言代码)浏览:727 |
WU-格式化数据输出 (C语言代码)浏览:1812 |
C语言程序设计教程(第三版)课后习题8.7 (C语言代码)浏览:928 |
K-进制数 (C语言描述,蓝桥杯)浏览:946 |
C语言程序设计教程(第三版)课后习题5.6 (C语言代码)浏览:530 |
罗列完美数 (C语言代码)浏览:513 |
2005年春浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:632 |
简单的a+b (C语言代码)浏览:850 |
1250题解浏览:594 |