⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 age2.c

📁 java 编程思想,很不错的源程序例子,请大家仔细看看.
💻 C
字号:
/* age2.c: Uses a switch */
#include <stdio.h>

int main()
{
    int age;
    char really;    // note position
    puts("Enter your age:");
    scanf("%d", &age);
    switch(age/20)
    {
    case 0:
        puts("youth");
        break;
    case 1:
        puts("prime");
        break;
    case 2:
        puts("aches and pains");
        break;
    case 3:
        puts("golden");
        break;
    default:
        printf("Are you really %d?\n", age);
        scanf(" %c", &really);
        if (really == 'Y' || really == 'y')
            puts("Congratulations!");
        else
            puts("I didn't think so!");
    }
    return 0;
}

            

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -