问题描述:
给出方程组:
11x+13y+17z=2471
13x+17y+11z=2739
已知x,y,z均为正整数,请你计算x,y,z相加最小为多少
#include<bits/stdc++.h>
using namespace std;
int main()
{
int max = 10000;
int a,b,c;
for(a = 1; a < 1000 ; a++){
for(b = 1; b < 1000 ; b++){
if(a == b) continue;
for(c = 1; c < 1000 ; c++) {
if( a == c || b == c) continue;
if( 11*a + 13*b + 17*c == 2471 &&
13*a + 17*b + 11*c == 2739) {
if(a+b+c < max) {
max = a+b+c;
}
}
}
}
}
cout << max; //181
return 0;
}