fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x; cin >> x;
  6. string a = "";
  7. while(x){
  8. char c = char((x % 8) + '0');
  9. cout << x % 8 << '\n';
  10. cout << c << '\n';
  11. x /= 8;
  12. }
  13. cout << a;
  14. return 0;
  15. }
Success #stdin #stdout 0.01s 5280KB
stdin
12
stdout
4
4
1
1