1 条题解

  • 0
    @ 2025-10-10 15:45:26

    C :

    #include<stdio.h>
    int main(){
    	int a,b,c;
    	scanf("%d%d%d",&a,&b,&c);
    	if(a+b>c&&a-b<c&&a+c>b&&a-c<b&&b+c>a&&b-c<a){
    		printf("Yes");
    	}else{
    		printf("No");
    	}
    	return 0;
    }
    

    C++ :

    #include<iostream>
    using namespace std;
    int main(){
        int a,b,c;
        cin>>a>>b>>c;
        if(a + b > c && b + c > a && a + c > b)    {
            cout<<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
       
    

    Pascal :

    var a,b,c,t:longint;
    begin
      read(a,b,c);
      if a>b then begin t:=a;a:=b;b:=t; end;
      if b>c then begin t:=b;b:=c;c:=t; end;
      if a>b then begin t:=a;a:=b;b:=t; end;
      if a+b>c then writeln('Yes') else
       writeln('No');
    end.
    

    Java :

    import java.util.Scanner;
    
    public class Main {
    
    	public static void main(String[] args) {
    		@SuppressWarnings("resource")
    		Scanner scanner=new Scanner(System.in);
    		 int a=scanner.nextInt();
    		 int b=scanner.nextInt();
    		 int c=scanner.nextInt();
    		 if(a+b<=c||a+c<=b||b+c<=a) {
    			 System.out.println("No"); }
    		 else  System.out.println("Yes");
    		
    		}
    }
    

    Python :

    #!/usr/bin/python3
    a,b,c=map(int,input().split())
    
    if a+b>c and a+c>b and c+b>a:
        print("Yes")
    else:
        print("No")
    
    
    • 1

    信息

    ID
    44
    时间
    1000ms
    内存
    512MiB
    难度
    10
    标签
    递交数
    7
    已通过
    4
    上传者