在本地测就能过

#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main(){
    int a, b, c;
    cin >> a >> b >> c;
    if(a > b)swap(a, b);
    if(b > c)swap(b, c);
    if(a+b > c){
        double p = (a+b+c)/2.0;
        p = p*(p-a)*(p-b)*(p-c);
        printf("%.2lf", sqrt(p));
    }else cout << "NO";
    return 0;
}

1 条评论

  • 啊??
    我用你的代码直接过了。。。
    没有一点改动

    • @ 2024-06-30 07:49:05

      啊???我这还是不行

    • @ 2024-07-25 10:51:44

      C++编译器里是这样的,你咋过的

      #include<iostream>
      #include<stdio.h>
      #include<cmath>
      using namespace std;
      int main(){
      ??? int a, b, c;
      ??? cin >> a >> b >> c;
      ??? if(a > b)swap(a, b);
      ??? if(b > c)swap(b, c);
      ??? if(a+b > c){
      ??????? double p = (a+b+c)/2.0;
      ??????? p = p*(p-a)*(p-b)*(p-c);
      ??????? printf("%.2lf", sqrt(p));
      ??? }else cout << "NO";
      ??? return 0;
      }
      
      
    • @ 2024-07-25 10:53:51

      @Infinity_: 试试这个(别问一不一样,试就行)

      #include<iostream>
      #include<stdio.h>
      #include<cmath>
      using namespace std;
      int main(){
          int a, b, c;
          cin >> a >> b >> c;
          if(a > b)swap(a, b);
          if(b > c)swap(b, c);
          if(a+b > c)
          {
              double p = (a+b+c)/2.0;
              p = p*(p-a)*(p-b)*(p-c);
              printf("%.2lf", sqrt(p));
          }
          else
              cout << "NO";
          return 0;
      }
      
    • @ 2024-08-02 11:10:04

      @240701zj苗逸宸 (240115zj苗逸宸): 不知道缩进是咋回事

  • 1

信息

ID
1701
难度
5
分类
(无)
标签
递交数
416
已通过
128
通过率
31%
被复制
4
上传者