Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n = 56789;
- int p = 1;
- while (p * 10 <= n) {
- p = p * 10;
- }
- while (n > 0) {
- int primaCifra = n / p;
- cout << primaCifra <<" ";
- n = n % p;
- p = p/10;
- }
Advertisement
Add Comment
Please, Sign In to add comment