Răspuns :
#include <iostream>
#include <climits>
using namespace std;
int minn = 1000005, x;
int main()
{
cin >> x;
if(x == 0) { cout << "NU EXISTA"; return 0; }
if(x > 0) minn = x;
while(x != 0)
{
cin >> x;
if(x > 0 && x < minn) minn = x;
}
if(minn == 1000005) cout << "NU EXISTA";
else cout << minn;
return 0;
}
#include <climits>
using namespace std;
int minn = 1000005, x;
int main()
{
cin >> x;
if(x == 0) { cout << "NU EXISTA"; return 0; }
if(x > 0) minn = x;
while(x != 0)
{
cin >> x;
if(x > 0 && x < minn) minn = x;
}
if(minn == 1000005) cout << "NU EXISTA";
else cout << minn;
return 0;
}
#include <iostream>using namespace std;
const int Inf = 0x3f3f3f3f;
int main(){ int n, minim{Inf}; while (n) { cin >> n; if (n > 0 && n < minim) minim = n; } if ( minim != Inf) cout << minim; else cout << "NU EXISTA";
return 0;}
const int Inf = 0x3f3f3f3f;
int main(){ int n, minim{Inf}; while (n) { cin >> n; if (n > 0 && n < minim) minim = n; } if ( minim != Inf) cout << minim; else cout << "NU EXISTA";
return 0;}