Advertisement
madidino

bac-test_antrenament-10-2021-sub3-3

Feb 11th, 2024 (edited)
1,009
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include <iostream>
  2. #include<fstream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     ifstream fin("bac.txt");
  8.     int n;
  9.     fin>>n;
  10.     int x;
  11.     int k=1;
  12.     while(fin>>x)
  13.     {
  14.         if(x<n)
  15.         {
  16.             k++;
  17.         }
  18.     }
  19.     cout<<k;
  20.     fin.close();
  21.     return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement