C++ 编程题:奇偶数之和判断 - 帮助禾木判定胜负
#include
int main() { int a; cin >> a;
int sum = 0;
while (a > 0) {
sum += a % 10;
a /= 10;
}
if (sum % 2 == 0) {
cout << "taozi" << endl;
} else {
cout << "wulahu" << endl;
}
return 0;
}
原文地址: http://www.cveoy.top/t/topic/pXvb 著作权归作者所有。请勿转载和采集!