美文网首页
acmtest1.d

acmtest1.d

作者: wolfway_d0ff | 来源:发表于2018-12-09 21:23 被阅读0次

三角形成立条件为两边和大于第三边,使用if语句解决,定义一个二维数组,使其可以多次输入,注意定义类型为double
...

include<iostream>

using namespace std;
int main()
{
double a[10000][3];
int n;
cin >> n;
for (int j = 0; j < n; j++)
{
for (int i = 0; i < 3; i++)
{
cin >> a[j][i];
}
}
for (int i = 0; i < n; i++)
{
if ((a[i][0] + a[i][1]) > a[i][2] && (a[i][0] + a[i][2]) > a[i][1] && (a[i][2] + a[i][1]) > a[i][0])
cout << "YES" << endl;
else
cout << "NO" << endl;
}
return 0;
}
...

相关文章

  • acmtest1.d

    三角形成立条件为两边和大于第三边,使用if语句解决,定义一个二维数组,使其可以多次输入,注意定义类型为double...

网友评论

      本文标题:acmtest1.d

      本文链接:https://www.haomeiwen.com/subject/baokhqtx.html