题解 | 小红的正整数计数
小红的正整数计数
https://www.nowcoder.com/practice/bf1c0694fdb84d12bc03793dee837117
#include <iostream>
using namespace std;
int main() {
int a, b;
cin>>a>>b;
cout<<(b-a+1+ (a%2==0?1:0) )/2;
return 0;
}
小红的正整数计数
https://www.nowcoder.com/practice/bf1c0694fdb84d12bc03793dee837117
#include <iostream>
using namespace std;
int main() {
int a, b;
cin>>a>>b;
cout<<(b-a+1+ (a%2==0?1:0) )/2;
return 0;
}
相关推荐