Baldrickk's user avatar
Baldrickk's user avatar
Baldrickk's user avatar
Baldrickk
  • Member for 9 years, 7 months
  • Last seen more than 4 years ago
Stats
341
reputation
20k
reached
4
answers
0
questions
Loading…
About

What does this do?

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#define s string
#define l length()
using namespace std;int a,b,c,d,e;int main(int i,char**f){vector<s>g;vector<int>h;s j;ifstream k(f[1]);while(getline(k,j)){c=0;b=-1;for(;;){b=j.find(" ",++b);if(b==s::npos)break;c++;if(c>d)d=c;if(j.l>a)a=j.l;}g.push_back(j);h.push_back(c);}for(i=0;i<g.size();i++){c=a-g[i].l;e=h[i]?c%h[i]:0;d=b=0;j={};for(;;d=b+1){b=g[i].find(s(" "),d);j+=s(g[i],d,(b==s::npos?b:b-d+1));if(b==s::npos)break;j+=s((h[i]?c/h[i]:0)+(e?e--,1:0),' ');}cout<<j;}}
Badges
This user doesn’t have any gold badges yet.
2
silver badges
7
bronze badges
Top tags
24
Score
4
Posts
100
Posts %
17
Score
1
Posts
25
Posts %
17
Score
1
Posts
25
Posts %
3
Score
1
Posts
25
Posts %
2
Score
1
Posts
25
Posts %
2
Score
1
Posts
25
Posts %
Top posts
answer
17
Sep 11, 2014
answer
3
Jul 25, 2017
answer
2
Sep 10, 2014