.


:




:

































 

 

 

 


. 1. ;




 

1. ;

2.

3. - .

4. ;

5. , .

.

1.

. :

() ;

;

( %);

.

2.

. :

( ==);

( -);

( ~),

, strset() , .

 

3.

//. :

) ;

) ;

) , ( %).

 

4.

. :

) () ( +, -);

) ( *).

 

5.

(, 10 * (cos(p / 6) + i * sin(p / 6)) (10, p/ 6).

:

) () ;

) ;

) ;

) ( ^);

) ( sqrt()).

 

6.

(, 5+3 (5, 3)). :

) () ( +, -);

) ( *);

) ( /);

) ( ^);

) ( sqrt()).

 

7.

...

( 24 ):

) ;

) ;

) ;

) ;

) , ( %).

 

8.

"". :

) () ;

) () ;

) ( )( &);

) X ( ());

) ( ~);

) (!).

 

9.

" ". :

) ( +);

) ( &);

) ( -);

) ;

) .

 

10.

" " ( m/n). :

) / ;

) / ;

) (!);

) ( ||).

.

+ , () .

#include <stdio.h>

#include <string.h>

const LEN=80;

struct String

{

char s[LEN];

int len;

};

String operator + (String S1, String S2)

{

String TmpS;

if((TmpS.len=S1.len+S2.len)>=LEN)

{ TmpS.s[0]='\0';

TmpS.len=0;

} else

{

strcpy(TmpS.s, S1.s);

strcat(TmpS.s, S2.s);

}

return TmpS;

}

void main()

{

String S1,S2,S3;

strcpy(S1.s, " - ");

S1.len=strlen(S1.s);

strcpy(S2.s, " !");

S2.len=strlen(S2.s);

printf(" : \n %s\n %s\n %d %d\n",S1.s, S2.s, S1.len, S2.len);

S3=S1+S2;// , <=> : operator+(s1, s2);

printf(" :\n\t%s %d\n", S3.s,S3.len);

}

.

 

1. : ; ; , , ; .

2. . , .. , , , - ..

3. .

4. .

5. ;

6. .

 

1. ?

2. , ?

3. - , - ?

4. ?

5. .

6. .

7. .

8. new delete.

9. .

10. .

11. .


 

13

 

Ȼ

. . , . , . .





:


: 2016-11-02; !; : 1258 |


:

:

.
==> ...

1511 - | 1341 -


© 2015-2024 lektsii.org - -

: 0.015 .