Advertisement
sdfxs

Untitled

Jul 10th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <iostream>
  3. #include <cmath>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int num;
  9.     int numinfor;
  10.     int stepen;
  11.     cout << "Vvedite 5-znachnoje chislo: ";
  12.     cin >> num;
  13.     for (int i = 4; i >= 0; i--) {
  14.         stepen = pow(10, i);
  15.         numinfor = ( num - num % stepen ) / stepen;
  16.         cout << 5-i << " cifra ravna " << numinfor << endl;
  17.         num %= stepen;
  18.     }
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement