Var i,p:integer; beginp:=1;for i:= 20 to 50 doif(i mod 5 = 0) then p:=p*i;writeln('Произведение чисел кратных 5: 'p);end.
#include <iostream>
using namespace std;
int sum( int n ){
int k = 0;
int t = n;
while ( t > 0 )
{
if ( ( t % 10 ) % 2 == 0 )
k++;
t /= 10;
}
return k;
}
int main()
{
int M,S,p;
cin >> M;
S = 0;
for ( int i = 1; i < M; i++ ){
p = sum(i);
if ( p == 0 ) {
S = S + i;
}
}
cout << S;
return 0;
}