Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define max 1000001
- long long sel(long long n)
- {
- long long a,p=0;
- while(n>0)
- {
- p+=n%10;
- n/=10;
- }
- a=n+p;
- return a;
- }
- int main()
- {
- long long self[max],s;
- for(long long i=1;i<max;i++)
- {
- self[i]=1;
- }
- for(long long j=1;j<max;j++)
- {
- s=sel(j);
- self[s]=0;
- }
- for(long long k=1;k<max;k++)
- {
- if(self[k]==1)
- cout<<k<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement