You will be given 3 integers as input. The inputs may or may not be different from each other. You have to output 1 if all three inputs are different from each other, and 0 if any input is repeated more than once.Input-----Three integers on three lines.Output------1 if the three inputs are different from each other, 0 if some input is repeated more than once
#include <stdio.h>void main(){ int a=0, b=0, c=0; printf("%c",(a==b)?'0':(c==a)?'0':(c==b)?'0':'1',scanf("%d%d%d",&a,&b,&c));}
Try this one. have used the ternary operator for deciding within the printf function combined with scanf to get the numbers.
# PYTHON 3 CODE#import sysnumbers= list(map(int, input().split()))for i in numbers: if numbers.count(i)>1: print("0") sys.exit(0)print("1")