题目描述
通过下列的等式,求出x、y、z的值分别为多少?
x+y=70
x+z=52
y+z=50
#include<iostream>
using namespace std;
int main(){
for(int x=1;x<100;x++)
{
for(int y=1;y<100;y++)
{
for(int z=1;z<100;z++)
{
if(x+y==70&&x+z==52&&y+z==50)
{
cout<<"x="<<x<<endl;
cout<<"y="<<y<<endl;
cout<<"z="<<z<<endl;
}
}
}
}
return 0;
}