1 solutions

  • 0
    @ 2025-3-3 16:34:00

    C :

    #include<stdio.h>   
    
    int main(){ 
    	int a,b,c;
    	scanf("%d %d %d",&a,&b,&c);
    	
    	if(a < b){
    		int t = a;
    		a = b;
    		b = t;
    	}
    	
    	if(b < c){
    		int t = b;
    		b = c;
    		c = t;
    	}
    	
    	if(a < b){
    		int t = a;
    		a = b;
    		b = t;
    	}
    	
    	if(a - b == 1 && b - c == 1){
    		printf("TRUE");
    	}else{
    		printf("FALSE");
    	}
    
    	return 0;
    } 
    

    Python :

    a,b,c = map(int,input().split());
    # a>b>c
    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==1 and b-c==1:
        print('TRUE')
    else :
        print('FALSE')
    
    • 1

    Information

    ID
    10894
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By