【正文】
ab) printf(“%d”,a)。 else printf(“%d”,b)。,printf(“%d”,ab?a:b)。,(5)The type of expression 1 and expression 2 can be same,also be different.,ex: int x。 x ? ‘a(chǎn)’ : ‘b’。,ex:xy ? 1 :1.5 。,?,Ex5: Input a letter,iudge it is a capital letter or not ,if is ,then change it to lowercase letter;if not ,then nothing changed。Finally,output this letter。,main() { char ch。 scanf( “ %c “ , },Return,?,main( ) { float x 。 int y 。 scanf(“ %f ” , },Return,?,Algorithm 2: input x ifx0 y=1 output y,Algorithm 3: input x ifx0 y=1 else: ifx=0 y=0 else: y=1 ouput y,?,p1: main() {float x。 int y。 scanf(“%f”, },p2:modify to : if(x=0) if(x0) y=1。 else y=0。 else y=1。,p3:modify to: y=1。 if(x!=0) if(x0) y=1。 else y=0。,p4:modify to: y=0。 if(x=0) if(x0) y=1。 else y=1。,Return,?,include main() { int x,y。 printf(“Enter an integer:“)。 scanf(“%d“, },ex,運(yùn)行:Enter an integer:12? integer:12absolute value :12,?,