Advertisement
Farjana_akter

Untitled

Feb 7th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. #include<math.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int b,n=0,c,k,d,i,j,l,m;
  8. cin>>b>>k;
  9. int a[k+5];
  10. for(l=0;l<k;l++)
  11. cin>>a[l];
  12. m=k-1;
  13. for(i=m,j=0;i>=0,j<k;i--,j++)
  14. {
  15. n+=((pow(b,i))*a[j]);
  16. cout<<n<<endl;
  17. }
  18. cout<<n<<endl;
  19. if(n%2==0)
  20. cout<<"even"<<endl;
  21. else
  22. cout<<"odd"<<endl;
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement