我写了如下代码:
#include <bits/stdc++.h> using namespace std; char c; vector<char> word; int main(){ while(c=getchar()!=-1) word.push_back(c); for(int i=0;i<word.size();i++) putchar(word[i]); return 0; }
input:
1+1=2 2+2=4 4+4=8 8+8=16 ...
output: