1个回答
展开全部
//你先输入要判断的数据组数 再把所有的数据输入
//程序就会输出符合勾股定理的三角形
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
int a,b,c;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> a >> b >> c;
if (a*a+b*b == c*c)
cout << "三边为:" << a << " " << b << " " << c << "的三角形符合勾股定理" << endl;
else
cout << "三边为:" << a << " " << b << " " << c << "的三角形 不 符合勾股定理" << endl;
}
return 0;
}
//程序就会输出符合勾股定理的三角形
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
int a,b,c;
cin >> n;
for (int i = 1; i <= n; i++)
{
cin >> a >> b >> c;
if (a*a+b*b == c*c)
cout << "三边为:" << a << " " << b << " " << c << "的三角形符合勾股定理" << endl;
else
cout << "三边为:" << a << " " << b << " " << c << "的三角形 不 符合勾股定理" << endl;
}
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询