18 条题解

  • 3
    @ 2024-2-23 10:41:00
    #include<stdio.h>
    int main(){
    	int a,b,c; 
    	scanf("%d%d%d",&a,&b,&c);
    	int t; //
    	if(a>b){
    		t=a;
    		a=b;
    		b=t;
    	} 
    	if(a>c){
    		t=a;
    		a=c;
    		c=t;
    	} if(b>c){
    		t=b;
    		b=c;
    		c=t;
    	} 
    	if(a+b<=c){ 
    		printf("Not triangle");
    	}else{  
    		if(a*a+b*b==c*c){
    		printf("Right triangle\n");
    	}
    	if(a*a+b*b>c*c){
    		printf("Acute triangle\n");
    	}
    	if(a*a+b*b<c*c){
    		printf("Obtuse triangle\n");
    	}
    	if(a==b||b==c){ 
    		printf("Isosceles triangle\n");
    	}
    	if(a==b&&b==c){
    		printf("Equilateral triangle");
    	}
    	}
    	return 0;
    }
    
    • 2
      @ 2024-3-1 14:04:29
      #include<stdio.h>
      int main(){
      	int a,b,c; 
      	scanf("%d%d%d",&a,&b,&c);
      	int t; //
      	if(a>b){
      		t=a;
      		a=b;
      		b=t;
      	} 
      	if(a>c){
      		t=a;
      		a=c;
      		c=t;
      	} if(b>c){
      		t=b;
      		b=c;
      		c=t;
      	} 
      	if(a+b<=c){ 
      		printf("Not triangle");
      	}else{  
      		if(a*a+b*b==c*c){
      		printf("Right triangle\n");
      	}
      	if(a*a+b*b>c*c){
      		printf("Acute triangle\n");
      	}
      	if(a*a+b*b<c*c){
      		printf("Obtuse triangle\n");
      	}
      	if(a==b||b==c){ 
      		printf("Isosceles triangle\n");
      	}
      	if(a==b&&b==c){
      		printf("Equilateral triangle");
      	}
      	}
      	return 0;
      }
      
      • 0
        @ 2024-11-17 20:14:13

        #include using namespace std; int main(void) { int a,b,c,t1,t2; cin>>a>>b>>c; if(a>b) swap(a,b);//swap 交换 if(b>c) swap(b,c); if(a>b) swap(a,b); t1=aa+bb;
        t2=c*c; if(a+b<=c) cout<<"Not triangle"<<endl; else { if(t1t2) cout<<"Right triangle"<<endl; if(t1>t2) cout<<"Acute triangle"<<endl; if(t1<t2) cout<<"Obtuse triangle"<<endl; if(ab||bc) cout<<"Isosceles triangle"<<endl; if(ab&&b==c) cout<<"Equilateral triangle"<<endl; } return 0; }

        • 0
          @ 2024-3-24 20:02:38

          #include #include #include using namespace std;

          bool is_triangle(int a, int b, int c) { return (a + b > c) && (a + c > b) && (b + c > a); }

          string triangle_type(int a, int b, int c) { if (a == b && b == c) { return "Equilateral triangle"; } else if (a == b || a == c || b == c) { return "Isosceles triangle"; } else if (a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a) { return "Right triangle"; } else if (a * a + b * b < c * c || a * a + c * c < b * b || b * b + c * c < a * a) { return "Obtuse triangle"; } else { return "Acute triangle"; } }

          int main() { int a, b, c; cin >> a >> b >> c; vector result; if (is_triangle(a, b, c)) { result.push_back(triangle_type(a, b, c)); } else { result.push_back("Not triangle"); } for (const auto &r : result) { cout << r << endl; } return 0; }

          • 0
            @ 2024-3-9 17:28:03

            #include <bits/stdc++.h> using namespace std; int main() { int a,b,c; int x,y,z; cin>>a>>b>>c; if(a<=b&&b<=c) { x=a; y=b; z=c; }else if(a<=c&&c<=b) { x=a; y=c; z=b; }else if(b<=a&&a<=c) { x=b; y=a; z=c; }else if(b<=c&&c<=a) { x=b; y=c; z=a; }else if(c<=a&&a<=b) { x=c; y=a; z=b; }else if(c<=b&&b<=a) { x=c; y=b; z=a; } else {

            }
            
            if(x+y>z&&x+z>y&&z+y>x)
            {	if(z*z==x*x+y*y)
            	{printf("Right triangle\n");}
            	
            	if(x*x+y*y>z*z)		
            	{printf("Acute triangle\n");}
            	
            	if(x*x+y*y<z*z)
            	{printf("Obtuse triangle\n");}
            	
            	if(x==y&&x!=z||x==z&&x!=y||z==y&&z!=x||x==z&&x==y&&z==y)
            	{printf("Isosceles triangle\n");}
            	
            	if(x==z&&x==y&&z==y)
            	{printf("Equilateral triangle\n");} 
            }
            else
            {	printf("Not triangle"); }
            return 0;
            

            }

            • 0
              @ 2024-3-3 13:36:39

              #include #include using namespace std;

              int main() { int a, b, c; cin >> a >> b >> c; int arr[3] = {a, b, c}; sort(arr, arr + 3); if (arr[0] + arr[1] <= arr[2]) { cout << "Not triangle" << endl; } else { if (arr[0] == arr[1] && arr[1] == arr[2]) { cout << "Equilateral triangle" << endl; } else if (arr[0] == arr[1] || arr[1] == arr[2]) { cout << "Isosceles triangle" << endl; } if (arr[2] * arr[2] == arr[0] * arr[0] + arr[1] * arr[1]) { cout << "Right triangle" << endl; } else if (arr[2] * arr[2] > arr[0] * arr[0] + arr[1] * arr[1]) { cout << "Obtuse triangle" << endl; } else { cout << "Acute triangle" << endl; } } return 0; }

              • 0
                @ 2024-2-23 10:36:32

                #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0;

                                                            • }
                • 0
                  @ 2024-2-23 10:35:20

                  #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0;

                    1. }
                  • 0
                    @ 2024-2-23 10:20:05

                    #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0; }

                    • 0
                      @ 2024-2-23 10:20:05

                      #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0; }

                      • 0
                        @ 2024-2-23 10:20:05

                        #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0; }

                        • 0
                          @ 2024-2-23 10:19:48

                          #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0; }

                          • -1
                            @ 2024-2-23 10:47:40

                            #include <bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(a+bc or a+cb or b+ca or a+b<c or a+c<b or b+c<a){ cout<<"Not triangle"; } if(a<b and a<c and b<c){ if((aa+bb)<cc){ cout<<"Obtuse triangle"; } if((aa+bb)==cc){ cout<<"Right triangle"; } if((aa+bb)>cc){ cout<<"Acute triangle"; } } if(a>b and a>c and b>c){ if((cc+bb)<aa){ cout<<"Obtuse triangle"; } if((cc+bb)aa){ cout<<"Right triangle"; } if((cc+bb)>aa){ cout<<"Acute triangle"; } } if(b>a and b>c and a>c){ if((cc+aa)<bb){ cout<<"Obtuse triangle"; } if((cc+aa)==bb){ cout<<"Right triangle"; } if((cc+aa)>b*b){ cout<<"Acute triangle"; } } if(ab and ac and cb){ cout<<"Equilateral triangle"; } if((ab and a!=c) or (ac and b!=a) or (bc and a!=c)){ cout<<"Isosceles triangle"; } return 0; }

                            • -1
                              @ 2024-2-23 10:41:13
                              #include<stdio.h>
                              int main(){
                              	int a,b,c; 
                              	scanf("%d%d%d",&a,&b,&c);
                              	int t; //
                              	if(a>b){
                              		t=a;
                              		a=b;
                              		b=t;
                              	} 
                              	if(a>c){
                              		t=a;
                              		a=c;
                              		c=t;
                              	} if(b>c){
                              		t=b;
                              		b=c;
                              		c=t;
                              	} 
                              	if(a+b<=c){ 
                              		printf("Not triangle");
                              	}else{  
                              		if(a*a+b*b==c*c){
                              		printf("Right triangle\n");
                              	}
                              	if(a*a+b*b>c*c){
                              		printf("Acute triangle\n");
                              	}
                              	if(a*a+b*b<c*c){
                              		printf("Obtuse triangle\n");
                              	}
                              	if(a==b||b==c){ 
                              		printf("Isosceles triangle\n");
                              	}
                              	if(a==b&&b==c){
                              		printf("Equilateral triangle");
                              	}
                              	}
                              	return 0;
                              }
                              
                              • -1
                                @ 2024-2-23 10:41:07
                                #include<stdio.h>
                                int main(){
                                	int a,b,c; 
                                	scanf("%d%d%d",&a,&b,&c);
                                	int t; //
                                	if(a>b){
                                		t=a;
                                		a=b;
                                		b=t;
                                	} 
                                	if(a>c){
                                		t=a;
                                		a=c;
                                		c=t;
                                	} if(b>c){
                                		t=b;
                                		b=c;
                                		c=t;
                                	} 
                                	if(a+b<=c){ 
                                		printf("Not triangle");
                                	}else{  
                                		if(a*a+b*b==c*c){
                                		printf("Right triangle\n");
                                	}
                                	if(a*a+b*b>c*c){
                                		printf("Acute triangle\n");
                                	}
                                	if(a*a+b*b<c*c){
                                		printf("Obtuse triangle\n");
                                	}
                                	if(a==b||b==c){ 
                                		printf("Isosceles triangle\n");
                                	}
                                	if(a==b&&b==c){
                                		printf("Equilateral triangle");
                                	}
                                	}
                                	return 0;
                                }
                                
                                • -1
                                  @ 2024-2-23 10:38:53

                                  #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0; }

                                  • -1
                                    @ 2024-2-23 10:37:37

                                    #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0;

                                    1. }
                                    • -1
                                      @ 2024-2-23 10:36:45

                                      #include<stdio.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); int t; // if(a>b){ t=a; a=b; b=t; } if(a>c){ t=a; a=c; c=t; } if(b>c){ t=b; b=c; c=t; } if(a+b<=c){ printf("Not triangle"); }else{ if(aa+bbcc){ printf("Right triangle\n"); } if(aa+bb>cc){ printf("Acute triangle\n"); } if(aa+bb<c*c){ printf("Obtuse triangle\n"); } if(ab||bc){ printf("Isosceles triangle\n"); } if(ab&&b==c){ printf("Equilateral triangle"); } } return 0;

                                                                                  • }
                                      • 1

                                      信息

                                      ID
                                      626
                                      时间
                                      1000ms
                                      内存
                                      128MiB
                                      难度
                                      4
                                      标签
                                      (无)
                                      递交数
                                      280
                                      已通过
                                      126
                                      上传者