Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- void main()
- {
- int N, c;
- m1:
- cout << "input number: ";
- if (cin >> N;)
- {
- if (N != 0)
- {
- if (N < 0)
- N = abs(N);
- for (int i = 9; i >= 0; i--)
- {
- int N1 = N;
- int f = 0;
- while (N1 != 0)
- {
- int a = N1 % 10;
- N1 = N1 / 10;
- if (a == i)
- f = 1;
- }
- if (f == 0)
- cout << i << " ";
- }
- }
- else
- {
- cout << endl << "Number must be different from 0" << endl << "Try again" << endl;
- goto m1;
- }
- }
- else
- {
- cout << endl << "Type mismatch" << endl << "Try again" << endl;
- goto m1;
- }
- cout << endl << "One more?" << endl << "0 - No / 1 - Yes: ";
- cin >> c;
- if (c == 1)
- goto m1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement