char做法
2026-10-25 13:05:02
发布于:湖南
10阅读
0回复
0点赞
我们可以只用判断第一个字符来写
#include<bits/stdc++.h>
#define int long long
using namespace std;
char c;
signed main(){
cin>>c;
if(c=='-') cout<<"negative";
else if(c=='0') cout<<"zero";
else cout<<"positive";
return 0;
}
这里空空如也

有帮助,赞一个