#include <iostream>
using namespace std;

int main() {

    int temp;
    int cont=0;

    do{

        cout<<"Inserisci una temperatura (-999 per terminare): ";
        cin>>temp;

        if(temp<0 && temp!=-999)
            cont++;

    }while(temp!=-999);

    cout<<"Temperature sotto lo zero: "<<cont<<endl;

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: