样例都没过!!!
查看原帖
样例都没过!!!
945043
Chenzhifei楼主2023/4/14 20:18
#include<bits/stdc++.h>
using namespace std;
int main(){
	int x,k,n;
	cin>>n;
	x=100;
	while(1){
		if(( n - x * 7 ) % 21 == 0 ){
			k=(n-x*7)/21;
			if(k>0)
				break;
		}
		x--; 
	}
	cout<<x<<endl;
	cout<<k<<endl;
} 
2023/4/14 20:18
加载中...