fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int TEN = 10;
  5.  
  6. int main() {
  7. int n;
  8. cin >> n;
  9. int noEven = 0;
  10. while (n >= TEN) {cout << n << "\n" ;
  11. if (((n / TEN) % TEN + n % TEN) % 2 == 0) {
  12. ++noEven;
  13. }
  14. n /= TEN;cout << n << "\n" ;
  15. }
  16. cout << noEven<<"perechi nr pare";
  17. return 0;
  18. }
Success #stdin #stdout 0s 5292KB
stdin
242301001
stdout
242301001
24230100
24230100
2423010
2423010
242301
242301
24230
24230
2423
2423
242
242
24
24
2
3perechi nr pare