Guest User

Untitled

a guest
Aug 10th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <sstream>
  4. #include <vector>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main() {
  10. int n = 1000001;
  11. vector<bool> v;
  12. v.reserve(n);
  13. for (int i=1; i<n; i++)
  14. {
  15. int aux, aux2;
  16. aux=i;
  17. aux2=aux;
  18. while (aux>0)
  19. {
  20. aux2 += aux%10;
  21. aux /= 10;
  22. }
  23. v[aux2]=true;
  24. }
  25. for (int i=1; i<n; i++)
  26. {
  27. if (!v[i])
  28. cout << i << endl;
  29. }
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment