Advertisement
Dizzy3113

Untitled

Nov 10th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int sfx(int x)
  6. {
  7. if(((x%1000)/100)>((x%100)/10) && ((x%100)/10)>(x%10))
  8. return 1;
  9. return 0;
  10. }
  11. int main()
  12. {
  13. int x, c=0;
  14. ifstream f("date.in");
  15. while(f>>x)
  16. {
  17. if(sfx(x)==1 && sfx(x/1000)==1)
  18. c++;
  19. }
  20. cout<<c;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement