.


:




:

































 

 

 

 


. 1)




1) .

2) .

3) . .

4) . s- () .

5) 21 . 5 10 3,8, 11 21 2,1, . .

6) , .

7) a. a [1] a [2] + a [3] a [4] +.... .

8) , , .

9) . , 100.

10) , 20 . , .

11) . , , , 50, .

12) , a b ( a b ; b>a).

13) 1 20 . , .

14) . , , 25.

15) . : ) ; ) . , .

16) : ) ; ) , .

17) , , 5. . ( ).

18) 12 (, , ) . . : 1) ; 2) .

19) . , .

20) . .

21) . , .

22) :

 

                             
                             
                             
                             
                             
                             
                             
)   )
23) :
         
         
         
         
         

 

                               

24) 20 ( , ..). 10. .

25) . ; , s.

26) . , .

27) . : .

28) . .

29) . , 13. , .

30) . , , , () , .

31) , .

32) , . : ) ; ) .

33) . 3 s.

34) , . , , .

35) 12 28 . ( ), 28 2004 , 2005 .

1. ? ? ?

2. ?

3. ?

4. ?

5. int p[]={2, 4, 6, 10, 1}; [3 ]?

6. :

int x[]={5,2,3,0,8};

for (i=1; i<=3; i++) { cout>>\n>>x[i]; }

7. ?

8. ?

9. int x[]={6, 4, 9, 3, 2}; ?

10. int m[6]={5, 3, 2}; m[4]?

11. : for (i=0; i<=5; i++) {A[i]=i; cout <<A[i]<< ;}

12. ?

13. ? ?

14. ?

15. c[i][j ]. , ?

16. ?

17. ?

18. R , 10- .

19. ?

20. ?

21. int p[3][3]={2, 4, 6, 10, 1, 12, 4, 0, 0}; [2][2]?

22. int m[2][2]={{5, 3}, {0, 2}}; m[1][2]?

23. [4][5]. ?

24. ( ):

int x[3][2]={5,2,3,0,8,1};

for(i=1; i<=3; i++)

{ for(j=1; j<=3; j++) cout>>x[i]>> ;

cout>>endl;}

 


2.1 ++

++ .

++ - , ('\0').

, : , :

char str1[10] = "string1"; //

, . - , , , , , . , "QWERTY" char[7], " " char[1]. char[1]? , , , ASCII- 0 ( escape- '\0'). , , , , .. , .

. ,

char str[] = "ABCDE"; - "ABCDE". , 6 : 'A','B','C','D','E' '\0'.

- . ++ .

, ++ , , str "ABCDE", 5 , C++ 6 , ( 0) .

, ( ) - (, - ):

char str[10] = "ABCDE"; 10 , 'A','B','C','D' 'E' , -.

5 "ABCDE", .

, , , , . .

char str[]={'A','B','C','D','E','\0'};

, , .

. , .

. "", .

. .

, , : 'A' '\n'. , . , , "Visual C++\n" : 'V', 'i', 's', 'u', 'a', 'l', ' ', 'C', '+', '+', '\n', '\0'. , "A" : 'A' '\0'. "", : "" "" , "".

:

// , . #include iostreamusing namespace std;void main(){ char str1 [ ] = "1234567890", /* str1 */ str2[11]; // /* , str2 str1 */ for(int i = 0; str1[i]!= '\0'; i++) str2[i] = str1[i]; // - str2. str2 [i] = '\0'; cout << str2 << '\n'; // }

, , str1[i] -, .. - str2, , .





:


: 2015-05-07; !; : 2430 |


:

:

, , . , .
==> ...

1538 - | 1379 -


© 2015-2024 lektsii.org - -

: 0.031 .