fork download
  1. #include <string>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main(int argc, char * argv[])
  8. {
  9. string s;
  10. cin >> s;
  11. int x = 0;
  12. for(const char * c = s.c_str(); *c; ++c)
  13. x = x*7 + (*c - '0');
  14. cout << x;
  15. }
  16.  
Success #stdin #stdout 0s 4992KB
stdin
126
stdout
69