Презентация на тему: Управляющие операторы языков программирования C, C++, VBA, Pascal

  • Published on
    17-Jun-2015

  • View
    524

  • Download
    2

Embed Size (px)

Transcript

  • 1. : 1- - .

2. :: if thenif then Pascal, DelphiPascal, Delphi if then elseif then else Pascal, DelphiPascal, Delphi if then elseif then else Pascal, DelphiPascal, Delphi ififthenthen case...of...endcase...of...end Pascal, DelphiPascal, Delphi switchswitch switchswitch CC whiledo...whiledo... Pascal, DelphiPascal, Delphi repeat...until...repeat...until... Pascal, DelphiPascal, Delphi for...to...do...for...to...do... Pascal, DelphiPascal, Delphi for...downto...do...for...downto...do... Pascal, DelphiPascal, Delphi forfor CC forfor CC CC forfor CC whilewhile CC () () -- ++ ++ Pascal, DelphiPascal, Delphi Visual BasicVisual Basic The end.The end. 3. , . , . , . , . : if switch. . while, for, do-while. break, continue, goto return. case, default . - , . , {}. . 4. if thenif then Pascal, DelphiPascal, Delphi ifif thenthen : : If Then If Then . . truetrue() () falsefalse().(). - - , . , . - , . - , . , , . , , . . ifif thenthen , , If Then ;If Then ; :: If Then If ThenIf Then If Then ;; : : IfIf GradeGrade=0 Then=0 Then WriteWrite( );( ); 5. if then elseif then else Pascal, DelphiPascal, Delphi If Then If Then Else ; If Then begin If Then Else ; , , beginend. : If Two=2 Then Writeln( 2) Else Writeln( 2!) 1 2 2 1 : If Then els; : , . . , else if. .. 6. if thenif then elseelse Pascal, DelphiPascal, Delphi , , , , . . :: If Then-1> Then Else If Then-2> Then Else If Then-3> Then .. Else If Then-n> Then . . , , , , , , . , . , , , , , . . .. , , , , , , , - - , , , , , , , , . .. . .. , , , , -.-. : : if Twoif Two = 2= 2 thenthen if One = 1 thenif One = 1 then Writeln('Writeln(' 1')1') elseelse WritelnWriteln(' 1 )(' 1 ) elseelse if Three = 3 thenif Three = 3 then Writeln(Writeln( 3)3) elseelse WritelnWriteln(' ');(' '); 7. ififthenthen , ++ ifthen : If () 1; Else 2; , : If (1) 1; Else If (2) 2; Else 3; - 100 . , , , , - . , if-else-if. if () ; else if () ; else if () ; else ; . if . , .. - , , , . , else, else , . 8. case...of...endcase...of...end Pascal, DelphiPascal, Delphi , ( ) , case. : case < > of : ; < 2> : ; < 3> : ; < n> : ; Else ; End; . , : case, of end. case of < >, , , , , . case. , , . else, < >, . . , , . case , ( , , ), . , . , . , . else case ( ) case . case 9. switchswitch switch ( ) . ( . , .) switch : switch if , , if . switch case . , switch , case . switch , . switch , , . 10. switch C switch switch. case switch , . , : switch (x) { case 1: switch(y) { case 0: printf (" n"); break; case 1: process(,y); break; } break; case 2: } 11. whiledo... Pascal, Delphi . , , . . . : While Do ; : < 2> < 3> . , , . ., , . , . : while True do ; . : While Counter < 3> repeat...until... begin...end . , repeat...until... : repeat ; ; ; until ; until . repeat ; ; ; Until False ; . , whiIe...do... , repeatuntil. , . : repeat write( , Counter); writeln; Counter:=Counter+2; until Counter=10 ; 13. forfor......toto......dodo... ... Pascal, DelphiPascal, Delphi . , . For j:=< 1> To < 2> Do : < 3> j:=1 j < 2>, - < 1> < 2>. , < 1> < 2>, . for. 14. for...downto...do...for...downto...do... Pascal,Pascal, DelphiDelphi for...downto...do... for forto...do... , , : for j := < 1> downto < 2> do ; , : for , , . repeat while repeat, , . while, , , , . - , . break, , for, while repeat. : While true do Begin Statement1; If expression then break; Statement2; End; continue , for, while repeat , . 15. forfor CC for , . for : for (; ; ) ; for . . , . , , ( ) . . ( for) . for , . , , for. for 1 100: #include int main(void) { int x; for(x=1; x

Recommended

View more >