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

KonstrPZ_FPO_LR2014_4LR

.pdf
Скачиваний:
6
Добавлен:
07.02.2016
Размер:
886.04 Кб
Скачать

r B / ' '

“Run” ( . 1.9), .

; 1.9 – B

; B , m ( 1.10):

; 1.10 – .

= B * «System.out.print("hello world")»,

, ' B «hello world». 9

' B B B. 8,

' B B B : System.out.print(5);

r B /i i

* / System.out.println(5); 9 , B :

System.out.print(5); System.out.print(5); System.out.print(5);

9 : 555

1 B :

System.out.print(5); System.out.println(5); System.out.println(5);

9 B: 55 5

1.3 ! 5 3 5

1.3.12 B ,

m , '

/ .

1.3.2D B B B Eclipse.

1.3.3=B /i :

1. < B Jav , B

m / * / B * “Sname T.F.”

2. =B B

.

1.=B m a=5 b=2 ( B

' B ' «a+b», '

B B ).

2.=B m a=7 b=1 (

B ' B ' «b-a», '

B B ).

3.=B m

a=4 b=3 ( B '

B ' «a/b», ' B B ).

4.=B m a=4.8 b=2 (

B ' B ' «a/b», '

B B ).

5.=B m a=9.15 b=11 (

B ' B ' «a+b», '

B B ).

6.=B m a=17 b=3 (

B ' B ' «a*b», '

B B ).

7.=B m a=5.1 b=2.2 (

B ' B ' «a*b», '

B B ).

8.=B m a=4.8 b=3 (

B ' B ' «a-b», '

B B ).

9.=B m a=15 b=22 (

B ' B ' «a+b», '

B B ).

10.=B m 10 22 (

B ' B ' «a*b», '

B B ).

3. < a b ( '

B ' a<b a>b), a>b B m

“better”, “lower”. = B ' B B F B B b.

9 ' B m 1

0.5 ( ' ).

4. =B B

.

? B ' , ,

:

BufferedReader br = new BufferedReader(new

InputStreamReader(System.in));

System.out.println("Input N: "); String str = br.readLine();

int N = Integer.parseInt(str);

& /i (

i / import).

1. ; , B /i / B '

 

K

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

, K – , B B.

 

i + j

2

 

i=1 j=1

 

 

 

 

 

 

 

 

 

 

 

2. ; , B /i / B '

A

1

 

B

 

 

 

l

 

 

 

 

 

+

 

 

 

 

 

, A B – , B B.

 

 

 

 

 

l=1

l

 

m=1 m

 

 

 

3. ; , B /i / B '

 

 

 

 

K

 

 

1

 

 

 

 

 

, if < K;

 

i + j

2

 

i=1

j=1

 

K – , B

X =

 

K

 

 

i

 

 

 

 

,

if K,

 

2

 

 

 

j=1

j

 

 

 

i=1

 

 

B.

4. ; , B /i / B '

 

A

 

1

 

B

l

 

 

 

 

 

+

 

 

, if

 

 

 

 

 

l=1

l

 

 

m=1

m

 

Y =

A

1

B

 

m

 

 

 

 

 

 

 

+

 

 

,

 

 

2

 

 

 

 

l

 

 

m=1 l

 

l=1

 

 

A < B;

, A B – , B

if A B,

B.

 

 

 

5. ; , B /i / B '

 

 

1

 

 

 

K

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3

+

i + j

3

, K – , B B.

i=1

i

 

 

 

 

j=1

 

 

 

 

 

 

 

 

6. ; , B /i / B '

 

K

 

j + 3

 

 

 

 

 

 

 

 

 

 

 

 

, K – , B B.

2

i=1

j=1

i + j

 

 

 

 

 

 

 

 

 

 

 

 

7. ; , B /i / B '

A

 

7

l

 

 

B

 

l

2

 

 

 

 

 

+

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

l

 

 

 

 

 

 

 

, A B – , B B.

l=1

 

 

 

 

m=1 m

+ l

 

 

 

8. ; , B /i / B '

 

 

 

 

 

 

K

 

 

 

j

 

 

 

 

 

 

 

 

 

 

 

 

 

, if < K;

 

 

i + j

2

 

 

i=1

 

j=1

 

 

 

 

K – , B

X =

 

 

 

K

 

2

+2

 

 

 

 

 

 

 

 

 

 

 

j , if K,

 

 

i

 

 

 

 

 

 

 

j=1

 

 

j

 

 

 

 

 

 

 

i=1

 

 

 

 

 

 

 

 

B.

9. ; , B /i / B '

 

A

1

B

m + l

 

 

 

+

 

, if

 

4

m

l=1

l

 

m=1

 

Y =

A

1

B

m

 

 

 

 

 

+

 

, if

 

2

 

 

 

l

 

m=1 l m

l=1

 

A < B;

, A B – , B

A B,

B.

10. ; , B /i / B '

 

1

 

K

i

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 +

i + j

4

 

, K – , B B.

 

i=1 i

 

 

j=1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5. =B B

. & B B.

 

 

 

1.

=B

 

 

*

y = sin(x)

 

 

x [0;2 ] q dx = /10 .

 

 

y = cos(x)

 

 

 

 

 

2.

=B

 

 

*

 

 

x [0;2 ] q dx = /10 .

 

 

 

 

 

 

 

 

 

 

3.

=B

 

 

 

*

y = tan(x) = sin(x)

 

x [0;4 ] q dx = / 5.

 

 

 

 

cos(x)

 

 

 

 

 

 

 

 

 

4.

=B

 

 

*

 

y = x sin(x) + 1

 

x [0; ] q dx = / 20 .

 

 

 

 

x

 

y = cos(x) + x sin(x)

 

 

 

5.

=B

 

 

*

 

x [0;2 ] q dx = /10 .

 

y = cos(x)sin(x)

 

 

 

6.

=B

 

 

*

 

x [0;4 ] q dx = / 5.

 

 

 

 

 

 

 

 

7.

=B * y = x +

x

 

 

 

x 20

x [0;15] q dx = 1.

8. =B

 

 

*

y = x2 +

x cos(x)

 

x3 20

x [1;21] q dx = 2 .

 

 

 

 

9. =B

 

 

*

y = x cos(x) + sin(x)

 

 

 

 

 

x 50

x [0;15] q dx = 1.

10. =B * y = sin(x2 )+

cos(x)

 

x [1;21] q dx = 2 .

x3 20

 

 

 

1.3.4 2* C .

 

 

1.3.5 2 B B.

 

 

1.4 !5 L 5 <M

1.4.19 B.

1.4.2.

1.4.3. .

1.4.4. m, B /

B, B B B.

1.4.5 =B B, ' i B B B

(5 q. B ), ' ' /i B

q, .

1.5 4K 5

1.5.1r q?

1.5.2r - ?

1.5.3. B B B B Java?

1.5.4& B ' 1/2 C 1, B ' 1/2.0 C 0.5?

1.5.5. B B ?

1.5.6= C i Java?

1.5.7r « »?

1.5.8r B int?

1.5.9r , B

: «int c = 5.2»?

1.5.10r : «double e = 1e9»?

2 A 1 1 B 1 A 2 1 1 A 1N O

2.1 J54K

8 B B * B.

2.2 5 5 5 <5 3 5 5!5

=' * B

B, ' F B. D .

2.2.1 5 657

D * B /

.

} , * , B

, , B

* - ' m B.

' B *,

C B B .

; : My, B B

m 4 GetFirstName(), SetFIrstName(name), GetSecondName(), SetSecondName(). <

*:

public interface IMy {

public String GetFirstName(); public String GetSecondName();

public void SetFirstName(String NewFName); public void SetSecondName(String NewSName);

}

. * B, B

, B My ' B B

/ *.

2.2.2 4

. B / ' / *. ? m ' «implements» 6 7,

9 97 :; My, : <= 9 ; 9 > 7 ? = IMy:

public class My implements IMy{

String fname; String sname; My()

{

};

public String GetFirstName() { return this.fname;

}

public String GetSecondName() { return this.sname;

}

public void SetFirstName(String NewFName) { this.fname = NewFName;

}

public void SetSecondName(String NewSName) { this.sname = NewSName;

}

}

. , B B

IMy.

2.2.3 P53

2 F B m m B . } m

C- , F m

.

8, B / My '

:

My d = new My();

& m, i m ' «.»:

d.SetFirstName("MyFitstName"); d.SetSecondName("MySecondName"); System.out.println(d.GetFirstName()); System.out.println(d.GetSecondName());

H B m:

MyFirstName

MySecondName

2.2.4 45! 5

8 B '

q * ,

- ( , B /

). 8 , B q ,

B / .

? B q *

/ extends.

class A extends B

{

//9 ; 7 :;

}

r B i /

/ super.

?

* .

< *

?

private ? *

private,

protected & B * protected

B

public ? *

public ' F

& . ;

,

B.

/* * ,-.// 012/34.56 /678596.

*/

public class Student { //:;< /678596.

private String fullName; //=0>?./6 /678596.

private int age;

public String getFullName() { return fullName;

}

public void setFullName(String fullName) { this.fullName = fullName;

}

public int getAge() { return age;

}

public void setAge(int age) { this.age = age;

}

public Student(String fullName, int age) { this.fullName = fullName;

this.age = age;

}

/*

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