Advertisement
Josif_tepe

Untitled

Mar 14th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     int n;
  7.     cin >> n;
  8.     int pomosna = n;
  9.     int dolzina = 0;
  10.     while(pomosna > 0) {
  11.         dolzina++;
  12.         pomosna /= 10;
  13.     }
  14.     dolzina /= 2;
  15.     int cifra;
  16.     while(dolzina >= 0) {
  17.         cifra = n % 10;
  18.         n /= 10;
  19.         dolzina--;
  20.     }
  21.     cout << cifra << endl;
  22.     return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement