7 条题解
- 1
信息
- ID
- 153
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 8
- 标签
- 递交数
- 10899
- 已通过
- 2082
- 上传者
这道题挺简单的,就是它的V太像U了
#include<iostream>
using namespace std;
int main()
{
int q;
cin>>q;
if(q>0) cout<<"positive";
else if(q==0) cout<<"zero";
else cout<<"negative";
return 0;
}
Python
a = input()
c = len(a)
d = int(c)
if d >= 0 and a[:1] != '-':
if d == '0':
print('zero')
else:
print('positive')
else:
print('negative')
#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
if(n>0) {
cout<<"positive";
} else if(n==0) {
cout<<"zero";
} else {
cout<<"negative";
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
if (n > 0)
{
cout << "positive";
}
else if(n == 0)
{
cout << "zero";
}
else{
cout << "negative";
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
int n;
int main()
{
cin >> n;
if (n > 0)
cout << "positive";
else if (n == 0)
cout << "zero";
else
cout << "negative";
return 0;
}
```用三个if条件判断即可
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
if (n > 0)
cout << "positive";
if (n == 0)
cout << "zero";
if (n < 0)
cout << "negative";
return 0;
}