void main()
{
int n
char M
do
{
printf("Please input the number of the month:\n")
scanf("%d",&n)
switch(n)
{
case 1:
printf("您输入的月份的英文名称是:January\n")
break
case 2:
printf("您输入的月份的英文名称是:February\n")
break
case 3:
printf("您输入的月份的英文名称是:March\n")
break
case 4:
printf("您输入的月份的英文名称是:April\n")
break
case 5:
printf("您输入的月份的英文名称是:May\n")
break
case 6:
printf("您输入的月份的英文名称是:June\n")
break
case 7:
printf("您输入的月份的英文名称是:July\n")
break
case 8:
printf("您输入的月份的英文名称是:Augest\n")
break
case 9:
printf("您输入的月份的英文名称是:September\n")
break
case 10:
printf("您输入的月份的英文名称是:October\n")
break
case 11:
printf("您输入的月份的英文名称是:November\n")
break
case 12:
printf("您输入的月份的英文名称是:December\n")
break
}
printf("Do you want to continue? Input Y or not\n")
scanf(" %c",&M)
}while(M=='Y')
}
#include <stdio.h>#include <string.h>
int main()
{int month,b,c
scanf("%d/%d/%d",&month,&b,&c)
switch(month)
{
case 1:printf("Jan,%d,%d\n",b,c)
break
case 2:printf("Feb,%d,%d\n",b,c)
break
case 3:printf("Mar,%d,%d\n",b,c)
break
case 4:printf("Apr,%d,%d\n",b,c)
break
case 5:printf("May,%d,%d\n",b,c)
break
case 6:printf("Jun,%d,%d\n",b,c)
break
case 7:printf("Jul,%d,%d\n",b,c)
break
case 8:printf("Aug,%d,%d\n",b,c)
break
case 9:printf("Sep,%d,%d\n",b,c)
break
case 10:printf("Oct,%d,%d\n",b,c)
break
case 11:printf("Nov,%d,%d\n",b,c)
break
case 12:printf("Dec,%d,%d\n",b,c)
break
default:printf("Data Error\n")
}
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)