枚举的艺术:函数思想 要求x,且x<y,枚举x,因为y为整数,则剩下的钱%19=0才是合法的x
#include<iostream> using namespace std; int main() { //23x+19y=823 ; 23x=823-19y ; 19y=823-23x ; x<y ; x? for(int x=1;x<=100;++x) { if((823-23*x)%19==0) { cout<<x; break; } } return 0; }
By signing up a QFNU-OJ universal account, you can submit code and join discussions in all online judging services provided by us.
Using your QFNU-OJ universal account