|
|
发表于 2018-1-16 23:31:38
|
显示全部楼层
print ("...........互动小游戏............")1 j% h K R( V5 C- x* ?: ]
. B0 {3 o( m, r, n6 c9 |7 J
while True:
# v% O8 a) b) M num1 = input("一号玩家设置的第一个加数是:"); j o/ B1 K E6 U
5 h5 {( Z9 }' _4 R num1 = int(num1)* Z$ N M. ~ ]; A6 [- o8 M, P
' r! o" w! n- p( X. g4 ?
num2 = input("一号玩家设置的第二个加数是:")% G- ?) o: r/ c3 f- a" ~" A$ w0 n* e
7 S5 x; `* d/ m6 k num2 = int(num2)
$ P" \# @& o# _( p4 X( C2 O: I& J8 {. F+ z H9 O6 w) P1 @2 o. X5 n9 D) w
print("二号玩家开始答题"): @ O4 }& x3 T2 n" L
+ y$ H$ G4 q0 o( y6 Z1 } print(num1,"+",num2)
; K' m" d, |7 y3 Q: y5 t
: y4 E9 S: d5 ?! M% ]# H: I- r daanz = num1 + num2
+ W. F3 L) Z$ r1 u
, P( [% f+ E, c$ E daanz = int(daanz)
/ i" y& q3 E; }9 }
2 d0 W. P& Q a4 Q$ y daanc = input("请问答案等于:")8 r* v- C$ U: i
% W2 y" ?" B: D# F Y. |( L) ?. q daanzc = int(daanc)" Q+ h3 x- d( R
" C- L, f' ^5 {; Q' s5 E4 s8 o if daanz == daanc:4 r8 r5 J7 [. J1 C1 W5 t
6 T9 y0 x) l7 ?$ S5 B
print("你真棒")2 P' o2 i6 ?/ S" O; M
1 x( {0 h8 E5 a" l% G0 Y$ \9 u
else:
6 A, j4 ?3 L1 d& \. ^# `5 H6 D. H, m; i5 P, v
print("下次加油"): I! R2 k' v p
: @! r: d, N7 P# E0 l! k @& X print("重新开始")
4 y3 z+ O D/ f2 s& Z. H* S7 j" Q |
|