听灌佬多,求调站外题qwq
  • 板块灌水区
  • 楼主LXY_elven
  • 当前回复24
  • 已保存回复24
  • 发布时间2024/8/11 19:45
  • 上次更新2024/8/11 20:50:53
查看原帖
听灌佬多,求调站外题qwq
1067991
LXY_elven楼主2024/8/11 19:45

首字母

题目描述

编程实现输入一个字符,当该字符为
时输出apple,当该字符为时输出banana,当该字符为时输出cat,否则输出no。

输入

输入一个字符。

输出

输出相应单词。

样例输入

t

样例输出

no

代码:

#include<bits/stdc++.h>
using namespace std;
int main(){
    int x;
    cin>>x;
    if(x==a){
        cout<<"apple";
    }
    if(x==b){
        cout<<"banana";
    }
    if(x==c){
        cout<<"cat";
    }
    else
        cout<<"no";
    return 0;
}
2024/8/11 19:45
加载中...