67分求助QAQ
  • 板块灌水区
  • 楼主rabbit_Cicy
  • 当前回复3
  • 已保存回复4
  • 发布时间2024/7/4 14:32
  • 上次更新2024/7/4 14:50:42
查看原帖
67分求助QAQ
1381549
rabbit_Cicy楼主2024/7/4 14:32
#include<bits/stdc++.h>
using namespace std;
int a, b, c;
int main(){
	scanf("%d%d%d", &a, &b, &c);
	int x[4]={0, a, b, c};
	sort(x+1, x+3+1);
	if(x[1]+x[2]<=x[3]) {
		printf("Not triangle\n");
		return 0;
	}
	if(x[1]*x[1]+x[2]*x[2]==x[3]*x[3]){
	    printf("Right triangle\n");
	    cout<<endl;
	}
	else if(x[1]*x[1]+x[2]*x[2]>x[3]*x[3]){
	    printf("Acute triangle\n");
	    cout<<endl;
	}
	else if(x[1]*x[1]+x[2]*x[2]<x[3]*x[3]){
	    printf("Obtuse triangle\n");
	    cout<<endl;
	}
	if(a==b||b==c||a==c){
	    printf("Isosceles triangle\n");
	    cout<<endl;
	}
	if(a==b&&b==c){
	    printf("Equilateral triangle\n");
	}
	return 0;
}

茜汐兔求解!!!

2024/7/4 14:32
加载中...