{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# ch5 - Q = ` ` ` ` if f switch f 5.1 5.1.1 < <= > >= =!= = <...

This preview shows pages 1–12. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
¨€OE if f switch f
§5.1 < <= > >= == ! = 5.1.1 % ( ) (SŠ ºª ( )

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
< f <= f > f >= E == f != a==b<c E a==(b<c) f H ºª H H c>a+b E c>(a+b) f H H H a=b>c E a=(b>c)
a=1,b=2,c=3 a>b f 0 º b<a+c f 1 º p f=a>b>c f f f 0 2. p f f f ” “ 1 0 f 5.1.2 1. ]p a>b, a+b>b+c, (a=3)>(b=5), ‘a’<‘b’ f

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
§5.2 § ] p 5.2.1 f C § p § f && f | | f p § §p f a&&b § f a
( p P89 f 5.1 ) a &&b f a f b ]p a ||b f a f a f !a f f a f !a f · f ˜ && || p && f || p f p (a>b)&&(x>y) (a==b)||(x==y) (!a)||(a>b) a>b&&x>y a==b||x==y !a||a>b

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
5.2.2 E f C 8 E p 1 f f 0 f f HÕŸ ºª “ª ” 0 f f 0 f f ¸Š a=4 f !a f 0 a=4,b=5 f a&&b f 1 f a||b f 1 f !a&&b f 0 f 5<3 &&2||8>4-!0 0&&1||8>3 0||1 1
1. a&&b&&c ð=À¬* TŠºª* year f 4 ª* 100 f f 4 400 f f a f 0 b f f a f b f 0 c f 2. a||b||c a f 0 b f f a f b f 0 c f (year%4==0 && year%100!=0) || year%400==0 !( (year%4==0 && year%100!=0) || year%400==0 ) p f

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
§5.3 if f 5.3.1 if 3 p 1. if ( f ) f 2. if ( f ) f 1 else f 2 if (x>y) printf(“%d”,x); f f f f f 1 f f f f 2 if (x>y) printf(“%d”,x); else printf (“%d”,y); if f ] p ? pu
3. if ( f 1) f 1 else if ( f 2) f 2 else if ( f 3) f 3 else f n f 1 f 1 f f f 2 f 2 f 3 f 3 f 4 f f f f if (num>500) cost=0.15; else if (num>300) cost=0.10; else if (num>100) cost= 0.075; else cost=0;

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 28

ch5 - Q = ` ` ` ` if f switch f 5.1 5.1.1 < <= > >= =!= = <...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online