www.ypnh.net > C++ 编程,三角形类

C++ 编程,三角形类

#include using namespace std;int main(){int s1,s2,s3;couts2>>s3;if((s1+s2

#include using namespace std; class triangle{ private: double a; double b; double c; public: triangle(double a1=1,double b1=1,double c1=1) { a=a1;b=b1;c=c1; } double Area() { double s=(a+b+c)/2; return sqrt(s*(s-a)*(s-b)*(s-c))...

#include using namespace std; int main() { int a, b, c; while(true) { cin >> a >> b >> c; if(a = 1000 || b = 1000 || c = 1000) { break; } if(a + b > c && a + c > b && b + c > a) { cout

#include #include using namespace std; class Ctriangle { public: void get_value(); double area(); float circumference(); void display1(); void display2(); public: double l1; double l2; double l3; double s; }; void Ctriangle::g...

#include#include using namespace std;int main(){ int a, b, c; int p; float s; coutb>>c; if(a+b>c && a+c>b && b+c>a){ break; } cout

#include #include using namespace std; class point { private:float x,y; public:point(float a,float b){x=a;y=b;} point(){x=0;y=0;} void set(float a,float b){x=a;y=b;} float getx(){return x;} float gety(){return y;} }; class tri{...

#include using namespace std;const char c='*';void output_line(int i, int n){int j;for(j = 0; j < n-i-1; j ++)cout

#include #include void main () { float a,b,c,d; float s; double area; scanf("%f%f%f",&a,&b,&c); if (a+b>c&&b+c>a&&a+c>b)//&&代表逻辑和 { s=(a+b+c)/2; d=s*(s-a)*(s-b)*(s-c); area=sqrt(d); printf("三角形面积=%d\n",area); } else {...

#includeusing namespace std;int main() { int a,b,c; cin>>a>>b>>c; if (a==b&&b==c) cout

步骤如下: 1,#include 2,using namespace std 3,int main() 4,{ 5,double a,b,c,s 6,couta>>b>>c;8,if( a+b=c)printf("the num you input is wrong!") 9,else 10,{ 11, s=(a+b+c)/2 12,cout

网站地图

All rights reserved Powered by www.ypnh.net

copyright ©right 2010-2021。
www.ypnh.net内容来自网络,如有侵犯请联系客服。zhit325@qq.com