fork download
  1.  
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main(void)
  6. {
  7. int n;
  8. cin>>n;
  9. vector<string> str(n);
  10.  
  11. for(int i=0;i<n;i++)
  12. cin>>str[i];
  13.  
  14. for(int i=0;i<n;i++)
  15. cout<<str[i]<<"\n";
  16.  
  17. for(int i=0;i<str.size();i++)
  18. {
  19. for(int j=0;j<str[i].length();j++)
  20. cout<<str[i][j]<<" ";
  21. cout<<"\n";
  22. }
  23.  
  24. return 0;
  25. }
  26.  
  27.  
Success #stdin #stdout 0s 4476KB
stdin
2
abc
xyz
stdout
abc
xyz
a b c 
x y z