美文网首页
练习2-5-2:根据输入选择输出(多分支结构,简单循环结构)

练习2-5-2:根据输入选择输出(多分支结构,简单循环结构)

作者: xmmhhh33 | 来源:发表于2021-12-26 14:20 被阅读0次

#include<stdio.h>

int main()

{

    int n;

    scanf("%d",&n);

    if(n==1)

        printf("Good morning!");

    else if(n==2)

        printf("Good afternoon!");

    else if(n==3)

        printf("Good nnight!");

    else

        printf("input error!");

    return 0;

}

相关文章

网友评论

      本文标题:练习2-5-2:根据输入选择输出(多分支结构,简单循环结构)

      本文链接:https://www.haomeiwen.com/subject/cpssqrtx.html