大佬们,为啥不从x=100开始遍历,从1开始也能过?不是要x尽量大嘛
查看原帖
大佬们,为啥不从x=100开始遍历,从1开始也能过?不是要x尽量大嘛
1034242
RingTouSou楼主2023/9/3 00:04
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n;
    cin>>n;
    for(int k=1;;k++){
        for(int x=1;x<=100;x++){
            if(52*((7*x)+(21*k))==n){
                cout<<x<<endl<<k;
                return 0;
            }
        }
    }
    return 0;
}
2023/9/3 00:04
加载中...