一个简单的程序 但是有些疑问,请大家帮忙看看
1.这个do..while循环为什么不管用?2.带颜色的部分该成*(month++)为什么不行?
#include "stdio.h"
main()
{int a[]={1,2,3,4,5,6,7,8,9,10,11,12},*p,i,b;
char m,*month[]={"January","February","March","April","May","june","july","August",
"September","October","November","December"};
p=a;
do{ printf("请输入月份:");
scanf("%d",&b);
if(b>12||b<1)
{printf("输入错误!是否继续(y/n)?");
scanf("%c",&m);}
else
for(i=0;i<12;i++)
if(*p++==b)
{printf("%d月的英文是%s",b,*(month+i));break;}
}while(m=='y'||m=='Y');
}
[[italic] 本帖最后由 llp108 于 2007-12-29 22:27 编辑 [/italic]]