用户名  找回密码
 中文实名注册
查看: 356|回复: 3

学习资料

[复制链接]

24

主题

62

回帖

1842

积分

版主

积分
1842
发表于 2022-3-13 18:25:07 | 显示全部楼层 |阅读模式
购买主题 已有 3 人购买  本主题需向作者支付 10 金钱 才能浏览
回复

举报

24

主题

62

回帖

1842

积分

版主

积分
1842
 楼主| 发表于 2022-3-13 18:29:41 | 显示全部楼层

ok
回复

举报

2

主题

34

回帖

579

积分

高级会员

积分
579
发表于 2022-3-13 18:36:39 | 显示全部楼层

回帖奖励 +10 金钱

#include<iostream>
using namespace std;

int main()
{
    int x,l,n,r,a;
    cout<<"n,L,R?"<<endl;
    cin>>n>>l>>r;
    x=0;
    for(int b=l;b<=r;b++)
    {
        a=b%n;
        if(x<a)
        {
            x=a;
        }
    }   
    cout<<"you can get at most "<<x;
    return 0;
}
回复

举报

16

主题

68

回帖

3602

积分

版主

你爸爸

积分
3602
发表于 2022-3-22 21:42:29 | 显示全部楼层
#include<iostream>
using namespace std;

int main()
{
    int x,l,n,r,a;
    cout<<"n,L,R?"<<endl;
    cin>>n>>l>>r;
    x=0;
    for(int b=l;b<=r;b++)
    {
        a=b%n;
        if(x<a)
        {
            x=a;
        }
    }   
    cout<<"you can get at most "<<x;
    return 0;
}
回复

举报

您需要登录后才可以回帖 登录 | 中文实名注册

本版积分规则

手机版|小黑屋|东台市机器人学会;盐城市极创科技有限公司 ( 苏ICP备2021035350号-1;苏ICP备2021035350号-2;苏ICP备2021035350号-3 )

GMT+8, 2025-4-23 04:32 , Processed in 0.092475 second(s), 31 queries .

Powered by Discuz! X3.5

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表