题解
2024-07-14 21:18:13
发布于:上海
0阅读
0回复
0点赞
#include<iostream>
using namespace std;
int n;
int b;
void scan ()
{
cin >> n;
}
void check ()
{
if (n > 0)
{
b = 1;
}
else if (n == 0)
{
b = 0;
}
else
{
b = -1;
}
}
void print ()
{
check();
if (b == 1)
{
cout << "positive";
}
else if (b == 0)
{
cout << "zero";
}
else
{
cout << "negative";
}
}
int main(){
scan();
print();
}
这里空空如也
有帮助,赞一个