Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- typedef long long int ll;
- #define read() freopen("input.txt", "r", stdin)
- #define write() freopen("output.txt", "w", stdout)
- map<int,bool>mp;
- int digitsum(int n)
- {
- int sum=0;
- while(n){
- sum+=(n%10);
- n/=10;
- }
- return sum;
- }
- void getself(){
- for(int i=1;i<=1000000;i++){
- mp[i+digitsum(i)]=true;
- }
- }
- int main()
- {
- getself();
- for(int i=1;i<=1000000;i++){
- if(!mp[i]){
- cout<<i<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement