Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main(){
- int n;
- while(1){
- string str;
- int aux=0,a=0;
- vector<string>v;
- scanf("%d",&n);
- if (n!=0){
- while(n--){
- cin>>str;
- a++;
- if (str.size()>aux){
- aux=str.size();
- }
- v.push_back(str);
- }
- for(int i=0;i<a;i++){
- if (v[i].size()<aux){
- for(int j=0;j<aux-v[i].size();j++){
- printf(" ");
- }
- }
- if (i==a-1){
- cout<<v[i]<<endl;
- printf("\n");
- }else{
- cout<<v[i]<<endl;
- }
- }
- }else{
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement