jyyeth


私信TA

用户名:jyyeth

访问量:34290

签 名:

C++学的完吗?

等  级
排  名 179
经  验 6662
参赛次数 0
文章发表 47
年  龄 0
在职情况 学生
学  校 徐州工程学院
专  业

  自我简介:

参考代码:
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    int n,tot=0;
    string a;
    cin>>n;
    getchar();
    while(getline(cin,a)){
        if(tot<n) cout<<a<<endl<<endl;
        else{
            for(int i=0;i<a.size();i++){
                if(a[i]==' ') cout<<endl<<endl;
                else cout<<a[i];
            }
            cout<<endl<<endl;
        }
        tot++;
    }
    return 0;
}



 

0.0分

2 人评分

  评论区