Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <sstream>
- #include <vector>
- using namespace std;
- int main() {
- int n = 1000001;
- vector<bool> v;
- v.reserve(n);
- for (int i=1; i<n; i++)
- {
- int aux, aux2;
- aux=i;
- aux2=aux;
- while (aux>0)
- {
- aux2 += aux%10;
- aux /= 10;
- }
- v[aux2]=true;
- }
- for (int i=1; i<n; i++)
- {
- if (!v[i])
- cout << i << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment