- 输出绝对值
答案
- 2023-5-19 21:21:39 @
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n<0){ cout<<(0-n); }
if(n>0){ cout<<n; }
if(n=0){ cout<<0; }
return 0;
}
1 条评论
-
xubohan LV 6 @ 2023-5-19 21:21:42
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if(n<0){ cout<<(0-n); }
if(n>0){ cout<<n; }
if(n=0){ cout<<0; }
return 0;
}
- 1
信息
- ID
- 29
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 1
- 标签
- 递交数
- 139
- 已通过
- 71
- 上传者