# Η ΓΛΩΣΣΑ C++ - ΜΑΘΗΜΑ 4 - ΚΛΑΣΕΙΣ ΚΑΙ ΑΝΑΦΟΡΕΣ (4διαφ)

Teacher & Manager at Δημήτρης Ψούνης - Υπηρεσίες Εκπαίδευσης
Oct. 4, 2019
1 of 7

### Η ΓΛΩΣΣΑ C++ - ΜΑΘΗΜΑ 4 - ΚΛΑΣΕΙΣ ΚΑΙ ΑΝΑΦΟΡΕΣ (4διαφ)

• 1. ! " # \$% ! " ! # \$ %&' ()*+,- \$ %&' ./012,3- \$ %&' 3,4,3,15,- ! " 6 7 8 6 %5/.' 5/1923+52/3- 6" 8 : ; < 8 = \$ " "" > &' ( ) * +' +' , * #! " - . * \$ * - / 0 ) - 1 0 1 2% 3 4 2 * * 1 5 1 ' - 0 ) 4 6 2 2 2 7 * 1 % - # 0 7 89: 3 ; - 2 % 7 1 89: * 7 1 ;' - # \$ < - / 0 * = 2% 3 2 * ' - \$ 2 = 0 " 1 4 2 1 > 0 * 4 0 2 ' - \$ 2 *> 1 - / ?89:989@A9B * 1 5 1 ?CDECFB 3 ' - 2 2 7 2 " 7 1 0 ) ) E@G6 89:H &' ( ) * +' I' # 0 7 \$ ! " - J 2 1 2 % 2 0 7 2*0 = \$ ! "# \$%& # ' \$% # \$ # %\$ () * + " !!, ,!! !!, ,!! !! " !!, ,!! !!, ,!! !! - " !!, ,!! !!, ,!! !! . /
• 2. &' ( ) * +' K' ''' 2 1 < \$! " - L % 1 50 0 1 % 2 1 2 7 ?3 ' \$% B - # \$ / \$ *> 2 3 7 2 * 0 5 \$ ' 0% # \$1 23 45 67 8 4 95 7 ! "# \$%& # ' \$% # \$ # %\$ () * +: ; " !!, ,!! !! ; < = 4>? 88 @>5 9 > 88 6>9 A8 9 " !!, ,!! !! B88 @> C6D 9 . / &' ( ) * I' 1 +' \$ 1 * ) ?MN OCDP9B %! " - Q 1 * 12 " 2% 4 7 %2 2 1 0 \$ " 1 * 1 - L + %2 * ) 4 %2 1 = 1 % 7 2 1 7* 1 4 0 0 " =) 2% 1 - = 0 * - # " 1 = 7 2 0 7 4 R 5 S * T E;F\$ G <7 6 ? 6 9 67 D 956 ! "# \$%& # ' \$% # \$ # F" H\$ ' ( FI) %\$ () * \$ J " !!,%\$ G \$ ,!!\$!! H\$ ' (\$) " !!,%\$ G \$ ,!!\$!! . / F" H\$ ' ( FI) * FI K " !!, H\$ ' G FI ,!!FI!! / &' ( ) * I' 1 I' \$ 1 * ) 0 * ?MN UVE@G98B &! " - L I %2 * ) 0 * 4 %2 1 = 1 % 7 2 1 7* 1 4 0 " =) 2% 1 - = 0 * E; " G <7 6 ? 6 9 67 D L>?M9 ! "# \$%& # ' \$% # \$ # F" H\$ ' ( I) %\$ () * \$ J " !!,%\$ G \$ ,!!\$!! H\$ ' ( \$) " !!,%\$ G \$ ,!!\$!! . / F" H\$ ' ( I) * I K " !!, H\$ ' G I ,!! I!! / - %2 RMN 89:989@A9T4 RMN UVE@G98T &' ( ) * I' 1 K' \$ 1 * ) ?MN 89:989@A9B '! " - L K %2 * ) ? %2 B - . % 1 \$ - # - \$ " 4 0 0 1 7 * *7 1 * 4 %2 0 \$ " *0 3 ' - 1 25 7 2 1 7* 1 0 " % 1 ' - 1 4 \$ 3 * 2 R " T 2% 0 \$ * 2 1 1 % 0 \$ " 1 % ) 0 * ' F" H\$ ' ( I) * I K " !!, H\$ ' G I ,!! I!! /
• 3. &' ( ) * I' 1 K' \$ 1 * ) ?MN 89:989@A9B (! " - . ) 2 %7 * - 7 " 8 : " ? @ - W % % * - AB 8 8 C X E; G <7 6 ? 6 9 67 D ! "# \$%& # ' \$% # \$ # F" H\$ ' ( I) %\$ () * \$ J " !!,%\$ G \$ ,!!\$!! H\$ ' (\$) " !!,%\$ G \$ ,!!\$!! . / F" H\$ ' ( I) * I K " !!, H\$ ' G I ,!! I!! / X YYY'Z99[F:V8Z99[F'V8Z &' ( ) * K' 1 7 1 +' *7 ) )*! " - 0 \$ " 1 1 % 2 * * * 4 ) - 1 7 * *7 1 1 ?%2) 7* 2 3 B - J 2 1 2 0 7 " ;0\$ '0E;0F\$ G N 65 3 O? 95O 3 C9 95M>?6> L5 P>9>Q>9 5 D C 5 6 ! "# \$%& # ' \$% # \$ # \$## %%; * E G %%;() R %%;() / F" ( %%; "E) %\$ () * %%; M 8>?9 5 " # " ( ) . / %%;GG %%;() * " !!,S" # ' ,!! / %%;GGR %%;() * " !!,T # ' ,!! / F" ( %%; "E) * 9 C 5 6 >? 5 9?O M 9 9 7 >9 5 9 9?O / &' ( ) * K' 1 7 1 +' *7 ) ))! " - ] 5 2 %7 \$ 1 "2) - ]= 7 - ^CE@ - ) 1 1 _ ? * AV@FG8PAGV8B' - :?_B - 1 7 * *7 MEG MN MEG ?0 * AV@FG8PAGV8B4 " % * ) ' - ) 1 4 *7 V - 1 \$ `CE@ - * _ * \$ 2 * 1 3 " 2'\$' % - ]2 1 * * 1 ) ?%\$ 0 * B 2 2 5 1 ? B4 *> 2 7 1 * - , 1 7 ) ?AVUN AV@FG8PAGV8B &' ( ) * K' 1 7 1 I' . % 1 7 1 ?AVUN AV@FG8PAGV8B )! " - 2 17 2 % ) 2 3 ) 4 - 2 " * 1 0 % 1 4 1 7 1' - / 0 ) 1 1 7 1 7* ) = - , * * ? *7 %B 2 1 1 > - , % 2 1 0 \$ * * ) 1 2 * 1 \$ 2 * ' - ( 0 " 1 2 2 5 - . " 8 % +' \$ " 1 ) % ) ?MN OCDP9B * I' ]2 1 ) ?MN OCDP9B * K' * 0 ) \$ 2 * % 14 ) % 1 1 \$##0 \$% ( " # \$##0 \$% "E)
• 4. &' ( ) * K' 1 7 1 K' % 0 \$ " * 1 ) )#! " D \$ - % 1 2 0 7 - 1 > 1 AVUN AV@FG8PAGV8 - J 2 1 7* % 0 \$ " 1 * ) ' " ;0 " # " 0\$ '0E;0F\$ G S" ; S" # " G U 5 6 67 D 956 ! "# \$%& # ' \$% # \$ # \$## %%; * E G %%;() %%;( " # %%; "E) R %%;() / F" ( %%; \$ ') &' ( ) * K' 1 7 1 K' % 0 \$ " * 1 ) )! " %\$ () * %%; " !!,V\$ G W " \$ ' ,!! ( ) " !!,V\$ G I \$ ' ,!! . / %%;GG %%;() * " !!,S" # ' ,!! . / %%;GG %%;( " # %%; "E) * " !!,S" ; " # " ,!! "E / %%;GGR %%;() * " !!,T # 'X,!! / F" ( %%; \$ ') * " !!,Y " ,!! / &' ( ) * K' 1 7 1 K' % 0 \$ " * 1 ) )\$! " - , 2 %7 125 - `CE@ - 1 > * ; - * 1 : - 1 > *7 ) 1 AVUN AV@FG8PAGV8 - * 2% *7 ?VMB % * ?;B - \$ M?;B - \$ " ) % - . 5 1 - *7 - . 5 `CE@ - * ; &' ( ) * K' 1 7 1 ' ]2 1 2% 1 ) )%! " D < 8 - % 1 2 0 7 - 1 > 1 AVUN AV@FG8PAGV8 - J 2 1 7* % 2 1 * ) ' " ;0 " # " 0 0"E G S" ; S" # " G Z=5 9 95M>567 3 ! "# \$%& # ' \$% # \$ # \$## %%; * E G %%;() %%;( " # %%; "E) R %%;() / %%; ()
• 5. &' ( ) * K' 1 7 1 ' ]2 1 2% 1 ) )&! " %\$ () * " !!,V\$ G W " \$ ' ,!! () " !!,V\$ G I \$ ' ,!! . / %%;GG %%;() * " !!,S" # ' ,!! . / %%;GG %%;( " # %%; "E) * " !!,S" ; " # " ,!! "E / %%;GGR %%;() * " !!,T # ' ,!! / %%; () * %%; "E " !!,Y " ,!! "E / &' ( ) * K' 1 7 1 ' ]2 1 2% 1 ) )'! " - , 2 %7 125 - 3 2 1 AVUN AV@FG8PAGV8< - % 7 ) * 01 % 0 " AVUN AV@FG8PAGV8 2 *2 ) 1 ' - 1 4 3 2 1 % 2 ) " 1 2 * 2 1 ' . V@DE@9abc \$ 1 2 * 3 2 * 0 7 2 *2 ) 1 ? ) 89GP8@ OCDP9 VUGE`EdCGEV@B - 0 1 > *7 ' - % 1 7 ) 0 \$ 1 3 2 * \$ 1 2 *' &' ( ) * K' 1 7 1 e' ) \$ 2 * ) 1 1 )(! " D \$ " "" - % 1 2 0 7 - 1 > 1 AVUN AV@FG8PAGV8 - J 2 1 7* % 0 5 1 * \$ 2 " ) 1 1' " ;0 " # " 0"E[ 0 \$ \$ " G N 8D 95M>567 3 67 D 88 3 95M>567 3 ! "# \$%& # ' \$% # \$ # \$## %%; * E G %%;() %%;( " # %%; "E) R %%;() / &' ( ) * K' 1 7 1 e' ) \$ 2 * ) 1 1 *! " %\$ () * %%; "EJ %%; "EK "EJ %%; "EK("EJ) . / %%;GG %%;() * " !!,S" # ' ,!! . / %%;GG %%;( " # %%; "E) * " !!,S" ; " # " ,!! "E / %%;GGR %%;() * " !!,T # ' ,!! /
• 6. &' ( ) * K' 1 7 1 e' ) \$ 2 * ) 1 1 )! " - , 2 %7 125 - `CE@ - 1 > * VM+ - / 0 ) _P``N VMI f VM+ * AVUN AV@FG8PAGV8 - * 2% VMI % VM+ - * 0" 0 ) - 0" * ' %%; "EK("EJ) #g. .h/ , 2 ) * 0 2 7 - _P``N VMI f VM+H ?0 ) \$ 2 * 4 * AVUN AV@FG8PAGV8B - VMI f VM+H ? 4 )2 * 12 % ) 1 fB &' ( ) * K' 1 7 1 i' # ! " - . AVUN AV@FG8PAGV8 * * 1 * ' - h > 2 *> " H - hj4 * 2 " 2 4 0 \$ > AVUN AV@FG8PAGV8 - % % MEG MN MEG 7 0 0 1 7 2 3 ' - % ) 1 01 0 \$ * - 2'\$' \$ 1 0 * 2 1 0 " 01 7 2* - % AVUN AV@FG8PAGV8 * # g j,/,. ' - * * % AV@FGH - AV@FG *> 1 % 0 2 2 2 \$ * \$ % * - # 7 4 0 1 1 AVUN AV@FG8PAGV8 * % 2 2 * 2% * 2 1 7 %\$ 2 = ' J' k + 1 FYCU #! " l 2 1 FYCU 5 0 \$ 0" * 1 ' - . 2 " * - E@G4 - _VPMD94 - * * ?3 ' I R] 7)7 T4 IB J' k I ]2 &mm&n ! " ]2 * &mm&n I 1 R K * T 1 7 1'
• 7. J' k K opmqra \$! " 1 * ?opmqraB 2 1 2 1 * 1 3 ) = - Q \$ ) 01 % 2* ?0 * B \$ ) 4 5 0 1 2* - Q \$ 1 - b9:CPDG - % 1 3 ? 7* 01 0 1 % 1 3 %0 1B - 7 1 - . 0 7 2 1 \$ 0 1 * 01 ' - a9GG98 1 3 - o9GG98 % 7 1 3 / 1 `CE@ - Q 1 > * 1 3 FG8+4 2 1 \$ 2 * ) RpsEF EF C FG8E@ZT - Q 7 1 3 FG8I ) 1 AVUN AV@FG8PAGV8' - Q > FG8+ RpsEF EF C @9Y FG8E@ZT - Q 125 0" 1 3