fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string number = "2443"; //jakas liczba w systemie 8 zalozmy
  7. int decNumber = 0; //tu bedzie wynik
  8. for(int i=0; i<number.size(); i++)
  9. decNumber = (decNumber * 8) + (number[i] - '0');
  10. cout << decNumber << endl;
  11. return 0;
  12. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
1315