E.cpp 379 B

123456789101112131415161718192021
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int x,sumz=0,tz=0,sumf=0,tf=0;
  6. while (cin>>x && x)
  7. if (x>0)
  8. {
  9. sumz+=x;
  10. tz++;
  11. }
  12. else
  13. {
  14. sumf+=x;
  15. tf++;
  16. }
  17. cout<<"Z:"<<tz<<"ge "<<sumz<<endl;
  18. cout<<"F:"<<tf<<"ge "<<sumf<<endl;
  19. return 0;
  20. }