10: week issue

10 weeks a few questions

Author: Turbo Time limit: 1S Section: branch structure

Description of the problem:
According to an integer ranging from 0 to 6, its output corresponds to English of the week. (0 corresponding to Sunday, 1 corresponds to Monday, 2 corresponding to Tuesday, 3 corresponds to Wednesday, 4 corresponding to Thursday, 5 corresponding to Friday, 6 corresponding to Saturday)

Input Description:
Enter an integer n (0 ≤ n ≤ 6) . Beginning of the line end of the line and no extra spaces.

Description Output:
Output a string, enter several weeks English name of the corresponding n, note the case. Beginning of the line and the end of the line do not print extra spaces.

Entry:
0
Sample output:
the Sunday
Code:

#include <stdio.h>
int main()
{
    int n;
    while (scanf("%d", &n) != EOF)
    {
        switch (n)
        {
        case 1: printf("Monday");
            break;
        case 2: printf("Tuesday");
            break;
        case 3: printf("Wednesday");
            break;
        case 4: printf("Thursday");
            break;
        case 5: printf("Friday");
            break;
        case 6: printf("Saturday");
            break;
        default:printf("Sunday");
        }
    }
    return 0;
}

Guess you like

Origin www.cnblogs.com/VictorierJwr/p/12242190.html