• 2021-04-14
    以下程序的功能是根据输入的是y(Y)还是n(N),在屏幕上分别显示出“This is YES.”或“This is NO.”,请填空。

    #include
    void YesNO(char ch)
    {
    switch(ch)
    {
    case 'Y':
    case 'y':printf("
    This is YES.
    "); ;
    case 'N':
    case 'n': printf("
    This is NO.
    ");
    }
    }
    main()
    {
    char ch;
    printf("
    Enter a char 'Y', 'y' or 'n', 'N': ");
    ch= ;
    printf("ch:%c",ch);
    YesNo(ch);
    }
  • 举一反三