题解 | #4#

4

https://ac.nowcoder.com/acm/contest/67238/D

第四题(https://ac.nowcoder.com/acm/contest/67238/D)

思路 第四题单纯就是判断平均分配的数量和剩下的数量孰大孰小,用if语句分别输出即可 代码

#include<iostream>
using namespace std;
int main(){
 long long a=1,b=1;
    cin>>a;
    cin>>b;
    if(a/b>a%b){
     cout<<"niuniu eats less than others";   
}
    if(a/b<a%b){
      cout<<"niuniu eats more than others";  
}
    if(a/b==a%b){
        cout<<"same";
}
}
全部评论

相关推荐

星辰再现:裁员给校招生腾地方
点赞 评论 收藏
分享
05-16 11:16
已编辑
东华理工大学 Java
牛客73769814...:盲猜几十人小公司,庙小妖风大,咋不叫她去4️⃣呢😁
牛客创作赏金赛
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务