fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define ll long long
  6. /*ll powt(ll x, ll y)
  7. {
  8.   if( y == 0)
  9.   return 1;
  10.   else if (y%2 == 0)
  11.   return powt(x, y/2)*powt(x, y/2);
  12.   else
  13.   return x*powt(x, y/2)*powt(x, y/2);
  14.  
  15. }
  16. */
  17. long long coun(long long num){
  18. long long ans=0;
  19. while(num){
  20. ans = ans+(num%10);
  21. num/=10;
  22. }
  23. return ans;
  24. }
  25.  
  26. int main(){
  27. long long a,b,c;
  28. cin>>a>>b>>c;
  29. long long d[100000];
  30. int count=0;
  31.  
  32. for(long long i=1;i<=81;++i){
  33. long long num =b*((long long)(powt(i,a))) + c;
  34.  
  35. if(num>=1&&num<1000000000){
  36. //cout<<coun(num)<< " "<<i<<" "<<num<<endl;
  37. if(coun(num)==i){
  38. d[count++] = num;
  39. }
  40. }
  41. }
  42.  
  43. cout<<count<<endl;
  44. for(int i=0;i<count;++i)
  45. cout<<d[i]<<" ";
  46. cout<<endl;
  47. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:33:55: error: ‘powt’ was not declared in this scope
                 long long num =b*((long long)(powt(i,a))) + c;
                                                       ^
stdout
Standard output is empty