fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n, a , b, copyN ;
  6. cin >> n >> a;
  7. copyN =n;
  8. int ten = 1;
  9. int number = 0;
  10. while (copyN > 10) {
  11. copyN /= 10;
  12. ten *= 10;
  13. }
  14. while (ten) {
  15. if (a / ten % 10 <= n ) {
  16. number = a / ten;
  17.  
  18. }
  19. cout << ten<< " ";
  20. ten /= 10;
  21. }
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0.01s 5512KB
stdin
7
1467852
stdout
1