Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Osnovy_programirovanniya_na_S_

.pdf
Скачиваний:
14
Добавлен:
02.02.2015
Размер:
3.52 Mб
Скачать

ASCII, ) Uni- code. Encoding.GetEncoding(1251)

System.Text.

fileIn -

ReadLine.

, ReadLine null.

.

Close().

,

,

.

, -

Stream-

Writer StreamReader.

3.

.

static void Main()

{

string s; double x, y;

StreamWriter f = new StreamWriter("out.txt"); StreamReader f1 = new StreamReader("in.txt"); f.WriteLine(" \n"); metka: s = f1.ReadLine();

if (s == null) goto metka1; x = Convert.ToDouble(s);

51

y = Math.Sqrt(x * x / (2 + Math.Exp(4 *

Math.Log(x))));

f.WriteLine(" x = {0:F3} y = {1:e3} \n", x, y);

goto metka;

metka1: f.WriteLine("

{0} \n", s); f.Close(); f1.Close();

}

in.txt

0,11

0,5

1

out.txt

x = 0,110 y = 7,778e-002

x = 0,500 y = 3,482e-001

x = 1,000 y = 5,774e-001

1)-

A, I, C, L, Name

52

(

2.3).

2)

2.4. 8 -

. LAB2.TXT. -

LAB2.RES

( 2.5) .

2.3

 

A

I

C

L

N

 

 

 

 

 

 

1

-14

-104

-0,00151

 

 

 

 

 

 

 

 

2

99,35

72

1995

 

 

 

 

 

 

 

 

3

0,086

-19

4,025

 

 

 

 

 

 

 

 

4

34

-6124

3,2 105

 

 

 

 

 

 

 

 

5

5,008

229

0,019

 

 

 

 

 

 

 

 

6

3,5 10-4

1989

-380,08

 

 

 

 

 

 

 

 

7

0,095

-1

1996

 

 

 

 

 

 

 

 

8

1,0074

102

107,7

 

 

 

 

 

 

 

 

9

993,285

112000

2,3 10-4

 

 

 

 

 

 

 

 

10

-2,1

444

103

 

 

 

 

 

 

 

 

11

3,125

6006006

-13,24

 

 

 

 

 

 

 

 

12

-45,077

30

25 1012

 

 

 

 

 

 

 

 

13

12,97

1002

-999,7

 

 

 

 

 

 

 

 

14

-0,09

2004

399,44

 

 

 

 

 

 

 

 

15

-142

-104

-0,00151

 

 

 

 

 

 

 

 

16

9,35

- 5072

19,95

 

 

 

 

 

 

 

 

17

0, 86

-19726

4,025

 

 

 

 

 

 

 

 

 

 

53

 

 

 

 

18

 

34

 

 

 

 

-6

 

3,2 103

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

19

 

5,008

 

 

 

-229

-0,019

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

20

 

3,5 10-4

1989

-380,08

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

21

 

0,095

 

 

 

-12

 

1996

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

22

 

1,0074

 

 

102

 

107,7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

23

 

993,285

 

112000

2,3 10-4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

24

 

-2,1 103

444

 

10-3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

25

 

3,125

 

 

 

6007007

-13,24

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

26

 

-45,07

 

 

123

 

25 1012

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

27

 

89,09

 

 

 

1000

999,002

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

28

 

-99,78

 

 

11

 

-1,774

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

29

 

7,99

 

 

 

-30077

1000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

30

 

0,124

 

 

 

-100400

-9000

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x*

 

y*

xmin

 

xmax

 

 

 

1

 

y

1 x2

 

 

2

 

-0,176

-3

 

3

 

 

1

 

 

 

1 x 4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

y

sin x

 

 

 

 

1,57

 

0,406

-2

 

2

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x 2 1

 

 

 

 

 

 

 

 

 

 

 

 

 

3

 

y

 

 

2

 

 

3,14

 

0,935

-2

 

4

 

 

3

 

 

 

 

x

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

 

y 4 x

1

 

 

1

 

4,5

0

 

2,5

 

 

4

 

 

 

x 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

54

 

 

 

 

 

 

 

 

 

 

5

y

 

sin 2 x

 

 

 

 

 

1,57

1,75

1,5

5

1

 

 

 

x

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6

y

x 2 5 x 4

2

-0,4

-2

3

2

 

 

x 2 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7

y 2

e

2 x

 

e

2 x

 

1

1

-1

1

3

e2 e 2

 

 

 

 

 

 

 

 

 

 

 

 

8

y

sin x

 

 

 

 

 

 

 

 

1,57

0,299

-2

2

4

x2 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

9

y e x sin(

x

)

-1

-2,7

0

2,5

1

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

10

y

 

 

 

2

 

 

 

 

 

 

 

 

 

 

0,5

1,9

-3

3

2

(x2 )

 

 

 

 

 

 

 

 

11

y ln

x3 x2

-0,6

0,43

-1

1,5

3

 

 

 

 

 

 

 

12

y x3 cos2 (x 3)

0,14

0,0027

-2

2

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

13

y

 

1

 

x 1

1,5

0,242

0

3

1

 

 

2 e

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

14

y

 

x

 

3 x

1

2,4

0

4

2

 

 

 

 

 

 

 

 

15

y 2 arctgx

sin x

1

1,57

-2

2

3

 

 

 

 

 

 

 

 

 

 

 

16

y x 2 3 sin

 

 

 

x

1,57

-0,53

-0,5

2

4

17

y x ( 1 cos

 

 

 

x )

0,5

0,5

-1,5

1,5

1

 

 

 

 

 

 

 

 

 

 

 

 

18

y

 

 

 

 

x e x

1

0,369

0

3

2

19

y

tgx

3 x 2

1,2

-1,75

-1,3

1,3

3

20

y e x sin 2 x

1,2

0,262

-2

2

4

55

21

y ln( x 1) cos 2 x

3

1,077

1

4

1

22

y x ( 1 cos

 

x )

-0,5

-0,5

-1,5

1,5

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

23

 

y

e 2 1 2

 

 

 

0,25

1,75

-2

2

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

24

 

y

xarctgx

 

 

 

1

1,4

-2

3

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

25

 

y x sin x

 

 

 

0,5

-0,5

-2

3

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

26

 

y x 3

5 x 2

4

x

0,5

0,875

-1

4

2

 

27

 

y 1 2 cos x sin 2 x

0

3

-2

2

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

28

 

y cos 2 x - 2

 

 

 

0

-1

-2

2

4

 

29

 

 

 

 

2

 

 

 

 

-1

-7

-2

3

1

 

 

y 2 x 5 x

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

30

 

y 2 ( x 3 9 x 2

1

 

1

-4

-2

5

2

 

 

)

3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2.5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7890123456789012345678901234 –

 

 

 

 

 

 

 

 

 

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

I---------------------------------------

 

 

 

 

 

 

I

 

 

 

 

 

 

I

X

I

 

 

I

 

 

 

 

 

 

I---------------------------------------

 

 

 

 

 

 

I

 

 

 

 

 

 

I X =…

I

Y =…

 

I

 

 

 

 

 

 

I X =…

I

Y =…

 

I

 

 

 

 

 

 

I---------------------------------------

 

 

 

 

 

 

I

 

 

 

 

 

 

: < . . . >

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

56

 

 

 

 

 

 

*******************************

 

* X =…

*

Y = …

*

 

*******************************

 

* X =…

* Y =…

*

 

*******************************

 

: < . . . >

 

 

 

 

3

 

 

 

+---------------------------------------

 

 

 

+

 

+

+

 

+

 

+---------------------------------------

 

 

 

+

 

+

X =…

+

Y =..

+

 

+

X =…

+

Y =…

+

 

+

...

+

...

+

 

+---------------------------------------

 

 

 

+

 

: < . . . >

 

 

 

 

 

 

4

:

 

 

 

 

Y(…) = …

 

Y(…) = …

 

: < . . . >

 

 

 

 

 

 

 

57

3

.

1.

, , -

, -

,

. -

, .

-

.

,

. -

.

, -

, -

, -.

-

. -

, -

-

-

.

. #,

, -

58

if, C# ,

IF ./

if

if ( ), ,

-

,

. -

.

.

if ( )

{

//( )

//,

}

//, .

-

. -

, .

boolean. -

true ( ),

. -

false ( ) -

.

59

1.

//, a b,

//max

max = b; if (a > b)

{

max = a;

}

,

b,

max. , max -

a.

, -

, .

2.

max = b;

if (a > b){max = a;}

.

,

( . 3).

3.

max = b;

if (a > b) max = a;

60

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]