#include <iostream>
#include <fstream>
int main()
{
using namespace std;
ifstream fin("data.txt");
// data.txt: 0 1 2 3 4 5 6 7 8 9
int n = 0;
int sum = 0;
int product = 1;
while (fin >> n) {
if (n % 2)
sum += n;
else if(n)
product *= n;
}
fin.close();
ofstream fout("result.txt");
fout << sum << " " << product << endl;
fout.close();
// result.txt: 25 384
return 0;
}
#include <fstream>
int main()
{
using namespace std;
ifstream fin("data.txt");
// data.txt: 0 1 2 3 4 5 6 7 8 9
int n = 0;
int sum = 0;
int product = 1;
while (fin >> n) {
if (n % 2)
sum += n;
else if(n)
product *= n;
}
fin.close();
ofstream fout("result.txt");
fout << sum << " " << product << endl;
fout.close();
// result.txt: 25 384
return 0;
}