Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n, p=0;
- cout << "introdu numarul:" << endl; cin >> n;
- for (int i = 9; i >= 0; i--)
- {
- int v = n;
- while (v > 0)
- {
- int c = v % 10;
- v /= 10;
- if (i == c)
- {
- p = p * 10 + c;
- break;
- }
- }
- }
- cout <<p<<endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement