难道这道题不能用循环吗?
查看原帖
难道这道题不能用循环吗?
738168
wang0728楼主2023/1/18 11:19
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n,l,r,max=0;
	cin>>n>>l>>r;
	for(int i=l;i<=r;i++)
	{
		if(max<i%n)
		{
			max=i%n;
		} 
	}
	cout<<max;
	return 0;
}//in.500000000 500004321 998244300          //out.498244300
2023/1/18 11:19
加载中...