这道题只需判断整数是否为不为0的数,如果是,输出1。否则输出0。
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a; cin>>a; if(a!=0) cout<<1; else cout<<0; return 0; }
注册一个 OI学习 通用账户,您就可以在我们提供的所有在线评测服务上提交代码、参与讨论。
使用您的 OI学习 通用账户