Сергей Кабыко int summ = 0; while( условие останова ) { int a; cin >> a; if( a % 2 == 0 ) summ += a; }