初学者的第一个程序,肯定有很多不好的,请指点~!
我种觉得它太烦琐了,有哪位高手能帮我为它减肥吗?
#include<stdio.h>
void main()
{
int ichance=0,icode;
for (;ichance<=4;ichance++)
{printf("please input your code:");
scanf("%d",&icode);
{if(icode==123)
{
printf("welcome to my program!");
break;
}
else
printf("your code is wrong! you only"
"have %d chance to input!\n",4-ichance);
}
}
if(ichance==5)
printf("EXIT MY PROGRAM!!!");
}
[此贴子已经被作者于2006-11-25 17:56:51编辑过]