Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. ifstream f("bac.in");
  7.  
  8. int main()
  9. {
  10. int x,max1=0,max2=0;
  11. while(f>>x)
  12. {
  13. if(x%10%3==0)
  14. if(x>max2)
  15. {
  16. max1=max2;
  17. max2=x;
  18. }
  19. else
  20. if(x>max1)
  21. max1=x;
  22. }
  23. cout<<max1<<" "<<max2;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement