Archlinux
GCC 13.1.1 20230429
2023-07-10 20:47:50 星期一
点击查看代码
#include<stdio.h>
int main()
{
int c_in, last_in;
c_in = 0;
last_in = 'a';
while( (c_in=getchar()) != EOF )
{
if( c_in != ' '){
putchar(c_in);
last_in = c_in;
}
if( c_in == ' ' ){
if( last_in != ' ' ){
putchar(c_in);
last_in = c_in;
}
}
}
return 0;
}
运行截图:
小白刚学习C语言,代码质量不高,欢迎评论。
标签:复制到,last,int,空格,编写,putchar From: https://www.cnblogs.com/yuwu/p/17542331.html