SelinD

ex119

May 16th, 2019
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int nr=0,s=0,x,y;
  6. cin>>x>>y;
  7. if(x%2==0)
  8. {
  9. s=2*x;
  10. nr=2;
  11. }
  12. while(x!=y)
  13. {
  14. if(y%2==0)
  15. {
  16. s=s+y;
  17. nr++;
  18. }
  19. cin>>y;
  20. }
  21. cout<<float s/nr<<" "<<nr;
  22. }
Add Comment
Please, Sign In to add comment