alex326

Untitled

Apr 16th, 2018
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. problema 249
  2.  
  3. #include <fstream>
  4. using namespace std;
  5. ifstream fin("pozitiex.in");
  6. ofstream fout("pozitiex.out");
  7. int main()
  8. {
  9. int v[10000],n,i,ok=0,c=1,x;
  10. fin>>x>>n;
  11. for (i=0;i<n;i++)
  12. fin>>v[i];
  13. for (i=0;i<n;i++){
  14. if (x>v[i])
  15. c++;
  16. if (x==v[i])
  17. ok=1;
  18. }
  19. if (ok==1)
  20. fout<<c;
  21. else
  22. fout<<"NU EXISTA";
  23. }
Add Comment
Please, Sign In to add comment