Advertisement
alexon5519

11-programare

Dec 11th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include<iostream>
  2. #include<fstream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main(){
  8. ifstream f1("atestat.in");
  9. ofstream f2("atestat.out");
  10. int x,y,max=0,c=0;
  11. while(f1>>x>>y){
  12. if(x > 0 && y > 0)
  13. c++;
  14. if(max==0)
  15. max=x+y;
  16. else
  17. if(max < x+y)
  18. max=x+y;
  19. }
  20. f2<<c<<' '<<max;
  21. f2.close();
  22. f1.close();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement