Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <math.h>
- using namespace std;
- long a[10000];
- int main()
- {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- long a,b,c,y;
- cin>>a>>b>>c;
- long n=-1;
- for (int i=1; i<36; i++)
- {
- long x=b*pow(i,a)+c;
- if (x<=10000)
- while (x>0)
- {
- y+=x%10;
- x/=10;
- }
- if (y==i)
- {
- n++;
- a[n]=x;
- }
- }
- n++;
- cout<<n<<endl;
- for (int i=0; i<n; i++)
- cout<<a[i]<<" ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement