Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- int a[n+1];
- for(int i=1;i<=n;++i)
- cin>>a[i];
- int svp=0,svpp=0,nnd10=0,snd3pi=0;
- for(int i=n;i;--i)
- {
- if(a[i]%2==0)
- svp+=a[i];
- if(i%2==0)
- svpp+=a[i];
- if(a[i]%10==0)
- ++nnd10;
- if(a[i]%3==0&&i%2)
- snd3pi+=a[i];
- cout<<a[i]<<' ';
- }
- cout<<'\n'<<svp<<'\n'<<svpp<<'\n'<<nnd10<<'\n'<<snd3pi<<'\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement