1 条题解
-
0
C :
#include<stdio.h> int main(){ int x,y; scanf("%d",&x); if(x>0){ y=x+1; }else if(x==0){ y=0; }else{ y=x-1; } printf("%d",y); return 0; }
C++ :
#include<iostream> #include<iomanip> using namespace std; int main(){ int x,y; cin>>x; if(x<0){ y=x-1; }else if(x==0){ y=0; }else{ y=x+1; } cout<<y<<endl; }
Python :
x=int(input()) if x>0: y=x+1 elif x==0: y=0 elif x<0: y=x-1 print(y)
- 1
信息
- ID
- 10820
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者