Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream f("bac.in");
- int main()
- {
- int x,max1=0,max2=0;
- while(f>>x)
- {
- if(x%10%3==0)
- if(x>max2)
- {
- max1=max2;
- max2=x;
- }
- else
- if(x>max1)
- max1=x;
- }
- cout<<max1<<" "<<max2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement