#include
#include
int main()
{
int n, f=0;
scanf ("%d", &n);
int a[n];
srand (time(NULL));
for (int i = 0; i < n; i++ )
{
a[i] = rand() % 20 -10;
printf ("%4d ", a[i]);
}
printf("\n");
for (int i = 0; i < n; i++ )
if (a[i]==0) f++;
if (f>0) printf("YES");
else printf("NO");
return 0;
}
Пример:
10
-1 -4 0 1 2 5 -7 -8 5 6
YES