>>52
#include <stdio.h>
#include <gmp.h>
int main(){
mpz_t inp;mpz_init(inp);
mpz_inp_str(inp,stdin,10);
mpz_add_ui(inp,inp,1);mpz_out_str(stdout,10,inp);
mpz_clear(inp);}
#include <iostream> //C++ version that looks more compact
#include <string>
#include <gmpxx.h>
int main(){//compile with -lgmpxx -lgmp
using namespace std;
string a;
mpz_class inp;
getline(cin,a) ;
inp.set_str(a,10);
cout<< inp+1;
}
#include <iostream>
#include <string>
#include <gmpxx.h>
void printinc(int base){ //(let ((*print-base* 10)) (print (1+ (read))))
using namespace std;
string a;
mpz_class inp;
getline(cin,a) ;
inp.set_str(a,base);
cout<< inp+1;
}
int main(){
printinc(10);
}
Lets reimplement this "the LISP way"
//(let ((*print-base* 10)) (print (1+ (read))))
#include <iostream>
#include <string>
#include <gmpxx.h>
std::string lispread(void){ std::string a;getline(std::cin,a);return a;}
mpz_class tonum(std::string x,int base){mpz_class a;a.set_str(x,base);return a;}
mpz_class inc1(mpz_class a){return a+1;}
void printbase(int base){ std::cout << inc1(tonum(lispread(),10));}
int main(){
printbase(10);
}
#include <iostream>
#include <string>
#include <gmpxx.h>
using namespace std;
string lispread(void){ string a;
getline(cin,a); return a;}
mpz_class tonum(string x,int base=10){
mpz_class a;a.set_str(x,base);return a;}
void printbase(int base=10){ cout << 1+(tonum(lispread(),base));}
int main(){
printbase();
}