C-用Switch语句输出星期

#include 
#include 

int main()
{
    int week;
    scanf("%d",&week);
    switch (week)
    {
    case 0:
        printf("sunday\n");
        break;
    case 1:
        printf("monday\n");
        break;
    case 2:
        printf("tuesday\n");
        break;
    case 3:
        printf("wednesday\n");
        break;
    case 4:
        printf("thursday\n");
        break;
    case 5:
        printf("friday\n");
        break;
    case 6:
        printf("saturday\n");
        break;
    }


    return 0;
}

你可能感兴趣的:(C-用Switch语句输出星期)