C++ 判断数字正负 - 完整代码示例
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
if (N > 0) {
cout << 'positive' << endl;
} else if (N == 0) {
cout << 'zero' << endl;
} else {
cout << 'negative' << endl;
}
return 0;
}
原文地址: https://www.cveoy.top/t/topic/qyiG 著作权归作者所有。请勿转载和采集!