mashlukashova

Untitled

May 20th, 2019
124
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <vector>
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main() {
  6. vector <int>a;
  7. int n;
  8. int v = 0;
  9. cout << "vvedite chislo: " << endl;
  10. cin >> n;
  11.  
  12. do {
  13. a.push_back(n % 7);
  14. v++;
  15. n /= 7;
  16. } while (n >= 1);
  17.  
  18. cout << "chislo v 7ichnoj sisteme: " << endl;
  19. for (int i = v - 1; i >= 0; i--){
  20. cout << a[i];
  21. }
  22. cout << endl;
  23. return 0;
  24. }
RAW Paste Data