STANAANDREY

sim 5/11/2021

May 11th, 2021 (edited)
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. 1.
  2. 8820
  3. 2.
  4. 2, 4
  5. 3.
  6. #include <iostream>
  7. using namespace std;
  8.  
  9. int main() {
  10. int n, x, m, p;
  11. cin >> n;
  12. x = 0, m = 0, p = 1;
  13. while (x < 10) {
  14. int cn = n;
  15. while (cn != 0) {
  16. int c = cn % 10;
  17. cn /= 10;
  18. if (c == x) {
  19. m = c * p + m;
  20. p *= 10;
  21. }
  22. }
  23. x += 2;
  24. }
  25. cout << m << endl;
  26. return 0;
  27. }
  28. 4.
  29. ...
  30. repeta
  31. ...
  32. pana cand cn = 0
  33. ...
  34.  
Add Comment
Please, Sign In to add comment