Long Loong

思路

一定会先打印一个'L'中间输出若干个‘o’,然后必然结尾是"ng",因此只需要中间用循环,然后头和尾写固定的输出即可。

#include<iostream>
using namespace std;
int main(){
    int N;
    cin>>N;
    cout<<'L';
    for(int i=0;i<N;++i) cout<<'o';
    cout<<"ng";
    return 0;
}
posted @ 2025-01-23 15:44  Buy-iPhone  阅读(7)  评论(0)    收藏  举报