Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- unsigned x,S,nrp,n;
- float ma;
- cin>>x;
- if (x%2==0)
- {
- S=x;
- nrp=1;
- }
- else
- {
- S=0;nrp=0;
- }
- do
- {
- cin>>n;
- if (n%2==0)
- {
- S+=n;
- nrp++;
- }
- }while (n!=x);
- ma=(float)S/(float)nrp;
- cout<<ma<<" "<<nrp;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement