Код:

#include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
int nSum = 0;
std::cout << "Vvedite 10 tselyh chisel:\n";
for (int i = 0; i < 10; i++)
{
int nValue = 0;
std::cin >> nValue;
if (nValue != 0) nSum = nSum + 1;
}
std::cout << "Chislo nenulevyh chisel: " << nSum << "\n";
return 0;
}
