当前位置: 代码迷 >> C语言 >> 字符型可以自动累加吗?
  详细解决方案

字符型可以自动累加吗?

热度:211   发布时间:2007-08-24 16:05:15.0
#include <stdio.h>
int main()
{
int num,num1;
char x;
for(num1=1;num1<=7;num++);
{
for (num=1;num<=7-1;x++); // <---- the cpu must be very busy here
printf(" ");
scanf("%c",&x);//不需要了吧
for(x='A';x<='G';x++);
printf("%c",x);
printf("\n");
}
return 0;
}
你的程序本身就有问题
----------------解决方案--------------------------------------------------------
回复:(zzxwill)我的程序也能达到要求,但是考虑当i=...
i counts from 0 to 6
and when i=6, no ' ' outputed.
nothing more but normal

----------------解决方案--------------------------------------------------------
  相关解决方案