用bool判断正负【闲的没事干】
  • 板块灌水区
  • 楼主coininin
  • 当前回复2
  • 已保存回复2
  • 发布时间2023/11/6 12:36
  • 上次更新2023/11/6 12:53:53
查看原帖
用bool判断正负【闲的没事干】
1027687
coininin楼主2023/11/6 12:36
#include<bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	bool a=0;
	long long b;
	cin>>b;
	if(b>a){
		cout<<"positive";
		return 0;
	}
	else if(b<a){
		cout<<"negative";
		return 0;
	}
	cout<<"zero";
	return 0;
}
2023/11/6 12:36
加载中...