Advertisement
Risonna

lab1_n6

Oct 30th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main()
  5. {
  6.     int x, y, z, f;
  7.     cout << "Enter x=";
  8.     cin >> x;
  9.     y = 100;
  10.     if ((x / 100) == 0)
  11.     {
  12.         cout << "число менее трех разрядов \n";
  13.     }
  14.     else
  15.     {
  16.         z = x / y;
  17.         f = z % 10;
  18.         cout << "Третий разряд справа = " << f << endl;
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement