题解列表

筛选

The 3n + 1 problem -题解(C语言代码)

#1095:The3n+1problem**起初忽略了begin与end的大小比较,因此答案出现了错误。******##插入代码-```c#includeintmain(){intbegin,end,i,j,cout,q,temp,flag=0;while(scanf("%d%d",

去掉空格-题解(C语言代码)

事实上这道题仍然不需要使用字符串,使用getchar逐个读入然后遇到空格就删去,最后使用putchar输出就可以了。这样应该比目前的优质题解简单不少吧。```c#includeintmain(void){chara;while((a=getchar())!=EOF)if(a!='')putchar(a

C语言训练-数字母-题解(C语言代码)

不想使用字符串,直接边读入边统计。使用getchar逐个读入字符然后判别是否是字母即可。为此需要注意结尾是EOF。````c#includeintmain(void){chara;intcount=0;while((a=getchar())!=EOF){if((a='A')||(a='a')){cou