Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #include<math.h>
- using namespace std;
- int main()
- {
- int b,n=0,c,k,d,i,j,l,m;
- cin>>b>>k;
- int a[k+5];
- for(l=0;l<k;l++)
- cin>>a[l];
- m=k-1;
- for(i=m,j=0;i>=0,j<k;i--,j++)
- {
- n+=((pow(b,i))*a[j]);
- cout<<n<<endl;
- }
- cout<<n<<endl;
- if(n%2==0)
- cout<<"even"<<endl;
- else
- cout<<"odd"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement