Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int a, i;
- for(a = 0; a < 1000 || a > 9999;)
- {
- cout << "Wprowadź liczbę czterocyfrową: ";
- cin >> a;
- if(a < 1000 || a > 9999)
- cout << "Liczba musi być z przedziału od 1000 - 9999!\n";
- }
- for(i = 1000; i >= 1; i /= 10)
- cout << (a / i)%10 << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement