Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<fstream>
- using namespace std;
- int main(){
- ifstream f1("atestat.in");
- ofstream f2("atestat.out");
- int x,y,max=0,c=0;
- while(f1>>x>>y){
- if(x > 0 && y > 0)
- c++;
- if(max==0)
- max=x+y;
- else
- if(max < x+y)
- max=x+y;
- }
- f2<<c<<' '<<max;
- f2.close();
- f1.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement