蓝桥杯训练 字符串的输入输出处理 格式有点坑

题目链接http://www.dotcpp.com/oj/problem1094.html

 

AC代码:

#include<iostream>
#include<cstring>
using namespace std;
const int maxn = 1e6+10;
//===================
int n;
char c[1000 + 10];
int main(){

    cin >> n;
    getchar();
    for (int i = 0; i < n; i++){
        gets(c);
        puts(c);
        cout << endl;
    }
    while (cin>>c){
        cout << c << endl<<endl;
    }
    return 0;
}
View Code

 

posted @ 2019-03-08 21:55  looeyWei  阅读(214)  评论(0编辑  收藏  举报