3 条题解

  • 2
    @ 2023-1-12 19:49:43

    p822和p879的结合,想进阶可做p825

    #include<iostream>
    #include<iomanip>
    #include<stdio.h>
    #include<math.h>
    #include<string>
    #include<cstring>
    using namespace std;
    int main(){
        double a,b,c,p,maxx,sum;
    	cin>>a>>b>>c;
    	maxx=max(a,max(b,c));
    	sum=a+b+c;
    	if(maxx<sum-maxx){
    		p=(a+b+c)/2;
    	    printf("%.2lf",sqrt(p*(p-a)*(p-b)*(p-c)));
    	}else{
    		cout<<"No Solution.";
    	}
    }
    
    • 1
      @ 2022-2-13 20:01:48
      #include <stdio.h>
      #include <iostream>
      #include <math.h>
      #include<iomanip>
      using namespace std;
      int main()
      {
      	double a,b,c,p,x;
      	cin >> a >> b >> c;
      	p=(a+b+c)/2;
      	x=(p-a)*(p-b)*(p-c)*p;
      	double s=sqrt(x);
      	if(a+b > c && a + c > b && c + b > a)
      	{
      		cout<<fixed<<setprecision(2)<<s<<endl;
      	}
      		else
      		{
      			cout<<"No Solution.";
      		}
      
      }
      
      • 0
        @ 2022-2-10 9:56:42

        #include <stdio.h> #include <iostream> #include <math.h> #include<iomanip> using namespace std; int main() { double a,b,c,p,x; cin>>a>>b>>c; p=(a+b+c)/2; x=(p-a)(p-b)(p-c)*p; double s=sqrt(x); if(a+b>c&&a+c>b&&c+b>a) { cout<<fixed<<setprecision(2)<<s<<endl; } else { cout<<"No Solution."; }

        }

        • 1

        信息

        ID
        878
        时间
        1000ms
        内存
        128MiB
        难度
        6
        标签
        (无)
        递交数
        648
        已通过
        194
        上传者