Baldrickk
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;}}
-
Member for 3 years, 7 months
-
0 profile views
-
Last seen Jun 21 '17 at 10:27
Communities (64)
- Stack Overflow 3.7k 3.7k 11 gold badge1111 silver badges2424 bronze badges
- Space Exploration 2.3k 2.3k 11 gold badge1616 silver badges2121 bronze badges
- Game Development 804 804 55 silver badges88 bronze badges
- Software Engineering 654 654 44 silver badges1212 bronze badges
- Super User 540 540 22 silver badges1010 bronze badges
- View network profile
Top network posts
- 98 Is this "Attach Orbiter Here / Note: Black Side Down" sign on the Shuttle Carrier Aircraft real?
- 48 Returning an empty string : efficient way in c++
- 45 Can/should you swim in zero G?
- 43 Multithreading program stuck in optimized mode but runs normally in -O0
- 43 Why is it so bad to optimize too early?
- 39 Why did the Tesla Roadster spend time in the Van Allen belt?
- 35 So, if there was nothing there but fear, who or what was under the blanket?
- View more network posts →
Keeping a low profile.
This user hasn't posted yet.