Advertisement
Myknakryu

Even further beyond

Oct 12th, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     int a, i;
  6.     for(a = 0; a < 1000 || a > 9999;)
  7.     {
  8.         cout << "Wprowadź liczbę czterocyfrową: ";
  9.         cin >> a;
  10.         if(a < 1000 || a > 9999)
  11.             cout << "Liczba musi być z przedziału od 1000 - 9999!\n";
  12.     }
  13.     for(i = 1000; i >= 1; i /= 10)
  14.         cout << (a / i)%10 << endl;
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement