Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- problema 249
- #include <fstream>
- using namespace std;
- ifstream fin("pozitiex.in");
- ofstream fout("pozitiex.out");
- int main()
- {
- int v[10000],n,i,ok=0,c=1,x;
- fin>>x>>n;
- for (i=0;i<n;i++)
- fin>>v[i];
- for (i=0;i<n;i++){
- if (x>v[i])
- c++;
- if (x==v[i])
- ok=1;
- }
- if (ok==1)
- fout<<c;
- else
- fout<<"NU EXISTA";
- }
Add Comment
Please, Sign In to add comment