|
這是我在某技術論壇上偶然看到的,看完之後我表示“震驚”,這位才女邏輯思維超棒的,非常的有創意噢,要是能被編譯出來就好了,哈哈~~ 一起來看看~
* {3 |" p1 E& n- U2 ?; y+ h* K3 G$ |! S# G& K
p. k. C0 ^$ s4 B& k2 f3 O4 n
result love(boy, girl)
6 G3 ?& `1 ~; y: l( b7 _, R
/ @ x2 K1 J. Y
% g+ v2 Y5 z% `4 w1 F- w {7 w+ p3 d4 [- B( n' W
if ( boy.有房() and boy.有車() )
+ `% `, k( g- Z! m& v4 L {
4 I! V2 z4 E3 N$ k6 A1 M boy.set(nothing);4 w# {! s0 z, F1 G
return girl.嫁給(boy);( r0 U0 b( U: c- M
}
) }& Z7 o' N/ a1 d" A6 C else if ( girl.願意等() )) |. \ |! X, Q4 d+ g+ Q
{' ?8 l" _' E Z7 J9 J' P
while( ! (boy.賺錢 > 100,000 and girl.感情 > 8 ) )
* Q( R0 Q0 ~) }: [ {
& x( M- o I" c! s for ( day=1; day <=365; day++)- `7 m, j; ]; l8 L
{- v( Y. r1 h( a$ B6 x
if ( day == 情人節 )
% l7 n7 m7 k! _7 X% ?6 C( q if ( boy.givegirl(玫瑰) )
0 k7 \0 Z" ~. u w girl.感情++;
( x- m) l/ | k+ ^* Y6 [1 L else3 @4 ^/ ]9 Q) o c- Z: z6 ~
girl.感情--;
, ~" I8 A/ m+ t& j" z if( day == girl.生日)
* E( j5 {6 @- z& y2 } if ( boy.givegirl(玫瑰) )
2 s2 c' L' B2 s+ d' G- a girl.感情++;
$ |; t' L- r4 K else. d: K9 c1 M' I! z, v
girl.感情--;
( w$ Z6 y ~5 K3 S5 o boy.拼命賺錢();3 U% U7 t2 {" U v: Z
if( girl.耐心 == 0 && girl.有其它追求者)) Y+ p" X& x6 X9 f
{
% k% y, J ]4 j girl.goto( another_boy);1 w5 X9 l2 d6 C4 f% d' u6 G
boy.鬱悶中();
* R) u+ s) k8 R0 L1 M* N boy.天天到論壇灌水();
% g4 s) ~, L- W) M/ i" L# n- M return 沒有結果;( P; E) h4 N0 _, ?' h% L
} ]3 T5 U5 G. X
}# e$ }# l8 C6 z5 ~5 i$ U
}
9 _5 p2 l! }2 F. U; Z( T try0 A" T5 N' K2 K0 }0 j! F, j5 u* `
{% B+ i, |6 o% ~. T6 e
girl.要男友買房();
/ p8 m% Z6 n- C' n# h0 N4 M girl.要男友買車();0 {, A1 t4 M! v/ j* |5 V4 E
girl.每天逛專賣店();
3 A# `2 r- s @) p, H9 m. a6 s7 \ if ( boy.有房() && boy.有車() )- Y! e) [7 ~8 x' X
{# v( V I$ m6 S# F7 q, T
girl.去澳洲旅遊(boy);
1 L* _5 l2 K4 Y- L! Q2 O( t3 k$ p girl.到英國威斯敏斯結婚(boy);
; V; ^& y+ _- q1 _/ g girl.嫁給(boy);
9 i- Y' p d3 s, ] boy.沒日沒夜掙錢();1 P( a" S1 x1 B4 J0 L3 R: s6 P0 l
}& v& C5 t' m6 z \$ R; E- t2 s
}- @' I% @, |. Z4 u4 L+ w
catch()
& m/ }+ m1 J0 s0 j {
- W2 p0 c) z1 i1 E) } girl.byebye(boy);
7 W* e; Z$ Z$ l1 d$ k boy.鬱悶中();
% r3 c9 S6 }0 k" N boy.天天到論壇職業話題灌水();1 q$ k, E0 E9 M: n+ W
return girl.broadcast(“這個男人真小氣“);7 G+ T4 k+ U3 D* J
}
1 _, D7 i: N( m% z9 ` return girl.每天逛專賣店();
" \; u3 O: x, R, W }+ X9 z! M( z" y- q7 N2 _- b
return girl.goto( another_boy);
5 ^1 V2 s- ^3 h; g6 G4 o7 k4 H) l# ~' d. _5 e9 x( D0 ]7 p
' g4 q! f5 n3 o6 i
5 b1 X( @, `1 Y# S
See on:http://wiznet2012.blogspot.kr/2012/08/c.html
. Q( g8 q$ v" s) ^' a* b" ^2 y3 n7 \( W) q0 q: X2 @
A- o# g2 l+ B8 Z' L- g3 L; O7 w% Y0 q5 @0 l) n
' u1 q6 _5 C; v8 s6 R+ p: P, Lif(gril.同意裸婚()){ return girl.嫁給(boy); } else girl.goto( another_boy);. |0 R" P" \& ]2 T' T* o; ~* w r
3 ?# T- Y) B: C0 A8 u5 N" B0 J
% d7 c: j( [; g: \5 z大家也來試著寫一個看看,分享一下吧~~~~~ |
|