XTU
http://202.197.224.59/OnlineJudge2/index.php/Problem/read/id/1144 View Code
1 #include<iostream>
2 #include<cstdio>
3 #include<string.h>
4 using namespace std;
5 char s[10000];
6 int main()
7 {
8 int t;
9 scanf("%d",&t);
10 getchar();//!!!!!!
11 for(int k=1;k<=t;k++)
12 {
13 gets(s);
14 int len=strlen(s);
15 printf("%s\n",s);// puts(s);
16
17 for(int i=1;i<len;i++)
18 {
19 if(s[i]==' ')
20 {
21 for(int j=0;j<i;j++)
22 printf(" ");
23 printf("%s\n",s+i);//puts(s+i);
24 }
25 }
26 printf("\n");
27 }
28
29 system("pause");
30 return 0;
31
2 #include<cstdio>
3 #include<string.h>
4 using namespace std;
5 char s[10000];
6 int main()
7 {
8 int t;
9 scanf("%d",&t);
10 getchar();//!!!!!!
11 for(int k=1;k<=t;k++)
12 {
13 gets(s);
14 int len=strlen(s);
15 printf("%s\n",s);// puts(s);
16
17 for(int i=1;i<len;i++)
18 {
19 if(s[i]==' ')
20 {
21 for(int j=0;j<i;j++)
22 printf(" ");
23 printf("%s\n",s+i);//puts(s+i);
24 }
25 }
26 printf("\n");
27 }
28
29 system("pause");
30 return 0;
31
1 #include<iostream>
2 #include<cstdio>
3 #include<string.h>
4 using namespace std;
5 char s[10000];
6 int main()
7 {
8 int t;
9 scanf("%d",&t);
10 getchar();//!!!!!!
11 for(int k=1;k<=t;k++)
12 {
13 gets(s);
14 int len=strlen(s);
15 printf("%s\n",s);// puts(s);
16
17 for(int i=1;i<len;i++)
18 {
19 if(s[i]==' ')
20 {
21 for(int j=0;j<i;j++)
22 printf(" ");
23 printf("%s\n",s+i);//puts(s+i);
24 }
25 }
26 printf("\n");
27 }
28
29 system("pause");
30 return 0;
31
2 #include<cstdio>
3 #include<string.h>
4 using namespace std;
5 char s[10000];
6 int main()
7 {
8 int t;
9 scanf("%d",&t);
10 getchar();//!!!!!!
11 for(int k=1;k<=t;k++)
12 {
13 gets(s);
14 int len=strlen(s);
15 printf("%s\n",s);// puts(s);
16
17 for(int i=1;i<len;i++)
18 {
19 if(s[i]==' ')
20 {
21 for(int j=0;j<i;j++)
22 printf(" ");
23 printf("%s\n",s+i);//puts(s+i);
24 }
25 }
26 printf("\n");
27 }
28
29 system("pause");
30 return 0;
31
1 1 #include<iostream>
2 2 #include<cstdio>
3 3 #include<string.h>
4 4 using namespace std;
5 5 char s[10000];
6 6 int main()
7 7 {
8 8 int t;
9 9 scanf("%d",&t);
10 10 getchar();//!!!!!!
11 11 for(int k=1;k<=t;k++)
12 12 {
13 13 gets(s);
14 14 int len=strlen(s);
15 15 printf("%s\n",s);// puts(s);
16 16
17 17 for(int i=1;i<len;i++)
18 18 {
19 19 if(s[i]==' ')
20 20 {
21 21 for(int j=0;j<i;j++)
22 22 printf(" ");
23 23 printf("%s\n",s+i);//puts(s+i);
24 24 }
25 25 }
26 26 printf("\n");
27 27 }
28 28
29 29 system("pause");
30 30 return 0;
31 31
2 2 #include<cstdio>
3 3 #include<string.h>
4 4 using namespace std;
5 5 char s[10000];
6 6 int main()
7 7 {
8 8 int t;
9 9 scanf("%d",&t);
10 10 getchar();//!!!!!!
11 11 for(int k=1;k<=t;k++)
12 12 {
13 13 gets(s);
14 14 int len=strlen(s);
15 15 printf("%s\n",s);// puts(s);
16 16
17 17 for(int i=1;i<len;i++)
18 18 {
19 19 if(s[i]==' ')
20 20 {
21 21 for(int j=0;j<i;j++)
22 22 printf(" ");
23 23 printf("%s\n",s+i);//puts(s+i);
24 24 }
25 25 }
26 26 printf("\n");
27 27 }
28 28
29 29 system("pause");
30 30 return 0;
31 31