[code]
//switch
#include
#include
#include
char cmd[20];
int main()
{
gets(cmd);
if (!strcmp(cmd,"january"))
{
printf("31\n");
}
if (!strcmp(cmd,"february"))
{
printf("28\n");
}
if (!strcmp(cmd,"march"))
{
printf("31\n");
}
if (!strcmp(cmd,"april"))
{
printf("30\n");
}
if (!strcmp(cmd,"may"))
{
printf("31\n");
}
if (!strcmp(cmd,"june"))
{
printf("30\n");
}
if (!strcmp(cmd,"july"))
{
printf("31\n");
}
if (!strcmp(cmd,"august"))
{
printf("31\n");
}
if (!strcmp(cmd,"september"))
{
printf("30\n");
}
if (!strcmp(cmd,"october"))
{
printf("31\n");
}
if (!strcmp(cmd,"november"))
{
printf("30\n");
}
if (!strcmp(cmd,"december"))
{
printf("31\n");
}
printf("\nPress anykey to leave......");
getch();
}
[code]
应该没有问题了
--------------------next---------------------
阅读(1155) | 评论(0) | 转发(0) |