题解 | #小美的外卖订单编号#

小美的外卖订单编号

https://www.nowcoder.com/practice/91506d447f3445c999a27d556e530a37

分类讨论题。

#include<bits/stdc++.h>
#define int long long
#define double long double
#define x first
#define y second
using namespace std;
typedef long long LL;
typedef long long ll;
typedef pair<int,int> PII;
const int N=3e5+10;
const int M=1e3+10;
int mod=1e9+7;
int a[N];

void solve(){
    int m,x;cin>>m>>x;
    if(x%m==0) cout<<m<<"\n";
    else cout<<x%m<<"\n";
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    int _;
    _=1;
    cin>>_;
    while(_--){
        solve();
    }
}

全部评论

相关推荐

joecii:如果没有工资,那可能没有工资是这家公司最小的问题了
找实习记录
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

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