age.c

来自「java 编程思想,很不错的源程序例子,请大家仔细看看.」· C语言 代码 · 共 31 行

C
31
字号
/* age.c: Comments on your age  */
#include <stdio.h>

int main()
{
    int age;
    puts("Enter your age:");
    scanf("%d", &age);
    if (age < 20)
        puts("youth");
    else if (age < 40)
        puts("prime");
    else if (age < 60)
        puts("aches and pains");
    else if (age < 80)
        puts("golden");
    else
    {
        char really;
        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 + =
减小字号Ctrl + -
显示快捷键?