Echo

来源:互联网 发布:javascript九九乘法表 编辑:程序博客网 时间:2024/06/09 22:51

描述

没有题目描述
    有题目描述
        题目描述
            目描述
                描述
                    述

输入

输入数据的第一行是一个整数 T,代表有 T 组测试数据。接下来的 T 行,每行是由一句话构成的一组测试数据,每句话都由一个空格(ASCII 码 32)分割的若干个单词连接而成,输入保证每行长度在 1到 4096 之间,且一句话的第一个和最后一个字符不会是空格。
 

输出

对于每组测试数据,输出若干行,其中最后一行是空行。注意输出格式 要与样例输出一致。
 

样例输入

2
zhe shi hui yin ni dong ma?
yukkuri shite itte ne!!!

样例输出

zhe shi hui yin ni dong ma?
    shi hui yin ni dong ma?
        hui yin ni dong ma?
            yin ni dong ma?
                ni dong ma?
                   dong ma?
                        ma?

yukkuri shite itte ne!!!
        shite itte ne!!!
              itte ne!!!
                   ne!!!

#include<iostream>#include<string>using namespace std;int main(){int n,len,i;string s;scanf("%d\n",&n);while(n--){getline(cin,s);len=s.length();cout<<s<<endl;for(i=0;i<len;i++){if(s[i]==' ')cout<<s<<endl;elses[i]=' ';}cout<<endl;}return 0;}


0 0
原创粉丝点击