.


:




:

































 

 

 

 


( ) .




 

 

 

:
   

 

 

mkdir $ mkdir _mkdir _1 _2 _3

 

DIR - . , . :
  • /A- :
  • D- ;
  • H- ;
  • S- ;
  • R- , ;
  • A- .
(-) . , DIR /A:-S - .
  • /B- ( );
  • /C- ;
  • /D- ;
  • /L- ;
  • /N- ;
  • /O- :
  • N- ( );
  • S- ( );
  • E- ( );
  • D- ( );
  • G- .

DIR [disk:] [] [ ] [/A[[:]]] [/B] [/C] [/D] [/L] [/P] [/N] [/Q] [/S] [/W] [/X] [/4] [/T [[:]]] [/O[:] ]]

CD CD [/D] [:] [:] CD [..] -

5

Copy
/d .
/v .
/y .
/-y .

copy [/d] [/v] [/n] [{/y|/-y}] [/z] [{/a|/b}] [{/a|/b}] [+ [{/a|/b}] [+...]] [ [{/a|/b}]]

Del (erase)
/p .
/f "
/s . .
/q . .

del [:][] _ [...] [/p] [/f] [/s] [/q]

Move
/y -.
/-y -.

move [{/y|/-y}] [] []

 

6

CD CD [/D] [:] [:] CD [..] -
Mkdir .

mkdir [:]

Move
/y -.
/-y -.

move [{/y|/-y}] [] []

7

8

> . :

1 > 1

1, 1.

1 < 1

1, 1 ( ).

1 < 1 > 2

. 1 1 2

9

, . :

1 | 2

1 2, :

1 >

2 <

rm

echo , :

echo -e "\n" | ftp localhost

ftp , localhost , Enter .

10

n - , - -n
-
,4--

11

sort -, .
-b, --ignore-leading-blanks  
-d, --dictionary-order ,  
-f, --ignore-case  
-i, --ignore-nonprinting  
-n, --numeric-sort  
-h, --human-numeric-sort (2K, 1G)
-c, --check , ;

 

grep , , , .   searchglobally for lines matching the regular expression, and print them , , .

: words.txt , a:

grep '^a' 'words.txt' 12
whoami: , , .
: [17:53] root@hemlock:~# whoamiroot
man-f
ps , .
-A ;
-a , , ;
-N ;
-d : , ;
-e ;
-f :
T ;
a , , ;
r ;
x , .
ps [] 13,14 (. ) 15,16

, ; . . , :

int fahr, celsius;

int lower, upper, step;

int , , float , . . , . .

int 16- ( -32768 32767), 32-. float 32- , 6 ( 10-38 10+38.

int float , :

char - - ;
short - ;
long - ;
double - .

 

 

17

ANSI . , signed, , unsigned.

signed ( ) unsigned ( ) char . unsigned 2n, n - . , char 8 , unsigned char 0 255, a signed char -128 127 ( ). char , , .

, 1234, int. long l L, 123456789L: , int, long. u U, ul UL , -unsigned long.

(123.4), (1-2), . , , double. f F float, l L - long double.

. , , 0x 0X, - . , 31 037 0X1F. L ( long) U ( , ). , 0XFUL 15 unsigned long.

18

short - ;
long - ;


, short, 16 , long - 32 , int - 16, 32 . , : short int 16 ; long - 32 ; short int, long.

19

enum , #define . enum, , . enum , #define. , enum .

, , - . , , ,


int lower, upper, step;

char , line[1000];

, :

int lower;

int upper;

int step;

char c;

char line[1000];

, , . , .

, , :

char esc = '\\';

int i = 0;

int limit = MAXLINE+1;

float eps = 1.0e-5;

 

- , , . , . . , , (").

const , .

 

20

: . .

, "". , , auto, . , register, .

, ( ) . ( , ) static. , , . static ( ), , extern ( ).

21,22

, 1234, int. long l L, 123456789L: , int, long. u U, ul UL , -unsigned long.

(123.4), (1-2), . , , double. f F float, l L - long double.

. , , 0x 0X, - . , 31 037 0X1F. L ( long) U ( , ). , 0XFUL 15 unsigned long.

, , , 'x'. . , '0' ASCII 48, 0 . '0', - ( 46), , , . , , .

-, \n ( ); , . ,

'\ooo'

- , (0 7)

'\xhh'

hh - , (0...9, ...f, A...F). ,

#define VTAB '013' /* ASCII */

#define BELL '\007' /* ASCII */

:

#define VTAB '\xb' /* ASCII */

#define BELL '\x7' /* ASCII */

(\ -

\b -- ()

\ f -

\n -

\r -

\t -

\v -

\\

\?

\'

\"

\ooo

\xhh )

'\0' - , null. 0 '\0', , .

- , . , , , , , ,

#define MAXLINE 1000

char line[MAXLINE+1];

#define LEAP 1 /* in leap years - */

int days[31+28+LEAP+31+30+31+30+31+31+30+31+30+31];

 

, , - , , , ,

"

"" /* */

, . , , -; \", , . (") ; ,

"," " !"

:

", !"

. '\0', , , . , , , . strlen(s) s '\0'. :

/* strlen: s */

int strlen(char s[])

{

int i;

i = 0;

while (s[i]!= '\0')

++i;

return i;

}

strlen , , <string.h>.

, , , : 'x' , "x". 'x' , x , "x" - , ( x) '\0'.

- . - , , ,

enum boolean {NO, YES};

enum 0, - 1 .. ( ). , , , :

enum escapes { BELL = '\a', BACKSPACE = '\b', TAB = '\t',

NEWLINE = '\n', VTAB = '\v', RETURN = '\r'};

enum months { JAN = 1, FEB, MAR, APR, MAY, JUN,

JUL, AUG, SEP, OCT, NOV, DEC};

/* FEB 2, MAR 3 .. */

. .

enum , #define . enum, , . enum , #define. , enum .

 

23

(. . ) +, -, *, /, %. , .

x % y

x y , , , x y . , , 4, 100. , , 400. ,

if ((year % 4 == 0 && year % 100!=0 || year % 400 == 0)

printf("%d \n", year);

else

printf("%d \n", year);

% float double . ( ) / % , .

+ - , *, / %, + -. .

, . ++ 1 , -- 1.

 

24

> >= < <=

. :

==!=

, , i < lim-1 , i < (lim-1), .. .

&& ||. , && ||, . , . - , , , getline, 1:

for (i = 0; i < lim-1 && ( = getchar())!= EOF && != '\n'; ++i)

s[i] = c;

, , s, , i < lim-1. , , . c EOF getchar; , getchar, .

&& , ||, , . ,

i < lim-1 && ( = getchar())!= '\n' && != EOF

. , != , ,

( = getchar())!= '\n'

, , '\n'.

1, , 0, .

! 0, 1. !

if (!valid)

if (valid == 0)

, . !valid (" ), , - .

 

25

. , . . char, short, int long, .

& -

| -

^ - .

<< - .

>> - .

~ - ().

& ( ) .

n = n & 0177;

n , .

| ( ) ; ,

x = x | SET_ON;

x, SET_ON.

^ ( ) 1, , 0, .

& | && ||, . , x 1, y 2, x & y , x && y - .

<< >> , , . , x << 2 x 2 , , x 4. . (" ), - (" ).

~ " . . .

x = x & ~077

x 6 . , x & ~077 , , , , x & 0177700, , x 16 . ~077 , ~077 - , .

getbits(x, p, n), n , x, p, . , 0- - , n p- . , getbits(x,4,3) 4, 3 2- x, . :

/* getbits: n , p- */

unsigned getbits(unsigned x, int p, int n)

{

return (x >> (p+1-n)) & ~(~0 << n);

}

x >> (+1-n) . ~0 , n (~0 << n) , n . ~ n .

 

26

 

+=, =, .

( + ) op=, op -

+ - * / % << >> & ^ |

1 2 - ,

1 op= 2

1 = (1) op (2)

, 1 . 2:

x *= y + 1

x = x * (y + 1)

x=x*y+1

bitcount, .

/* bitcount: */

int bitcount(unsigned )

{

int b;

for (b = 0; != 0; x >>= 1)

if (x & 01)

b++;

return b;

}

, , x unsigned , , .

, , . " 2 i" " i 2", " i, 2 i", i+=2 , i=i+2. ,

yyval[yypv[p3+p4] + yypv[p1+p2]]+= 2

+= , , , , . , .

, : :

while (( = getchar())!= EOF)

(+=, -= . .), . .

 

27

if-else . :

if ()

1

else

2

else- . , , (. . ), 1. (. . ) else-, 2.

if , . ,

if ()

,

if (!= 0)

, , , .

else- if- . , else if, else.

 

goto . , , . goto.

, goto . , . break , . :

for (...)

for (...) {

...

if (disaster) /* */

goto error; /* */

error: /* */

, .

, . goto , . . .

 

28

switch . , , , :

switch () {

case -:

case -:

default:

}

case . case, . case . , , , default, , . case default .

break switch. case , case, , . break return . break while, for do-while.

 
 

 


break break break

 

 

 
 


29

 

while ()

 

. , , . , , , .

 

do-while :

do

while ();

, . , . . , . do-while repeat-until , , .

, do-while , while for. , , , itoa ( atoi), . , , . , , .

/* itoa: n s */

void itoa(int n, char s[])

{

int i, sign;

if ((sign = n) < 0) /* */

n =-n; /* n */

i = 0;

do { /* */

s[i++] = n %10 + '0'; /* */

} while ((n /= 10) > 0); /* */

if (sign < 0)

s[i++] = '-';

s[i] = '\0';

reverse(s);

}

do-while , s , n . ( ), while while.

 

30

 

while ()

. , , . , , , .

for

for (1; 2; 3)

1;

while (2) {

3;

}

 

for , 1 3 , 2 - . , . 1, 3 , ; 2, , . ,

for (;;) {

}

"" , , , - , break return. :while for - . ,

while ((c = getchar()) ==' ' || c == '\n' || c == '\t')

; /* - */

, , while.

, , for, .

, , n , :

for (i = 0; i < n; i++)

...

 

31

continue - break, . (for, while do-while) . while do-while , for - . continue , switch. switch, , .

, a ( ).

for (i = 0; i < n; i++) {

if (a[i] < 0) /* */

continue;

... /* */

}

continue , , .

 

32

 

, , . - .

( ) .

:

< >( )

, : , , .
, , int.
() , , . , , , . :

fun1(int a, int b, float d);

 





:


: 2017-02-11; !; : 427 |


:

:

, ,
==> ...

1474 - | 1393 -


© 2015-2024 lektsii.org - -

: 0.323 .