на языке C++:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
int main () {
int result = 1;
int c;
string answer = "";
while (1) {
cout << "Введите число";
cin >> c;
if (c == 999)
if (result == 1)
{cout << "Не введены отрицательные числа"<< endl; return 0;}
else {cout << "результат: " << result << endl; return 0;}
else if (c<0)result *= c;
cout << "продолжить? <YES> | <NO> ";
сin.getline(answer, sizeof(string));
if (strcmp(answer, "YES")==0) continue;
else return 1;
}
}