[GESP2512一级] 手机电量显示

题目信息:

经典结构:输入n,输入n个数字

本题形容为:输入T组,每组1个数字P

任务:根据P的数据范围,确定输出R、L、或数字

模拟题

解题逻辑:

#include <iostream>
using namespace std;
int main(){
    int T,P;
    cin>>T;
    for(int i=1;i<=T;i++){
        cin>>P;
        if(P<=10) {
            cout<<"R"<<endl;
        }
        else if(10<=P&&P<=20){
            cout<<"L"<<endl;
        }
        else{
            cout<<P<<endl;
        }
    }
    return 0;
}