var x, L, M: integer;
begin
readln(x);
L:=0; M:=0;
while x > 0 do begin
L:= L + 1;
if x mod 2 != 0 then
M:= M + x mod 10;
x:= x div 10;
end;
writeln(L); write(M);
end.
|
#include<iostream>
using namespace std;
main()
{
int x, L, M;
cin >> x;
L = 0; M = 0;
while (x > 0)
{
L = L + 1;
if (x % 2 != 0)
M = M + x % 10;
x = x / 10;
}
cout << L << endl << M;
}
|
x = int(input())
L = 0
M = 0
while x > 0:
L += 1
if x % 2 != 0:
M = M + x % 10
x = x // 10
print(L)
print(M)
|