Học tại trường Chưa có thông tin
Đến từ Chưa có thông tin , Chưa có thông tin
Số lượng câu hỏi 30
Số lượng câu trả lời 9
Điểm GP 0
Điểm SP 5

Người theo dõi (2)

Đang theo dõi (6)


Bài 1. Chia quà                                                                       Tên file: gift.***

Bà mua cho hai anh em Việt và Nam n quả táo, bà muốn chia đều số táo cho hai anh em. Trong trường hợp n chẵn thì hai anh em sẽ nhận được số táo bằng nhau, trong trường hợp ngược lại thì em Nam sẽ nhận số táo nhiều hơn Việt 1 quả.

Hãy cho biết số táo của Việt và Nam.

Input: một số nguyên n

Output: số táo của Việt và Nam

Ví dụ:

INPUT

OUTPUT

9

4 5

8

4 4

Bài 2. Tìm giá trị min, max                                                    tên file: MINMAX2.***

Cho 2 số nguyên a, b.

Em hãy lập trình tìm giá trị nhỏ nhất và lớn nhất trong 2 số a, b.

Input: 2 số nguyên a, b.

Output: hai số nguyên là giá trị nhỏ nhất và lớn nhất

Ví dụ:

INPUT

OUTPUT

4 3

3 4

 

Bài 3. Tìm giá trị min, max                                                    tên file: MINMAX4.***

Cho 4 số nguyên a, b, c, d.

Em hãy lập trình tìm giá trị nhỏ nhất và lớn nhất trong 4 số a, b, c, d.

Input: 4 số nguyên a, b, c, d

Output: hai số nguyên là giá trị nhỏ nhất và lớn nhất

Ví dụ:

INPUT

OUTPUT

4 3 7 2

2 7

Bài 5. Trò chơi oản tù tì                                                                  tên file: GAMES.***

Hai bạn Bắc và Nam chơi trò chơi oản tù tì, trong quá trình chơi mỗi người chơi sẽ đưa ra một trong ba hình dạng của bàn tay là: búa, kéo và bao. Trong đó luật chơi được mô tả như sau:

·        Người chơi ra hình búa sẽ thắng người chơi ra hình kéo.

·        Người chơi ra hình kéo sẽ thắng người chơi ra hình bao.

·        Người chơi ra hình bao sẽ thắng người chơi ra hình búa.

Hai người chơi ra hình giống nhau thì sẽ hòa.

Tại một lượt chơi, hai bạn Bắc và Nam sẽ đưa ra một hình dạng bàn tay của mình. Em hãy lập trình cho biết kết quả ai là người thắng, hoặc hai bạn hòa nhau.

INPUT:

Gồm hai số nguyên ab (0 ≤ a, b ≤ 2). Trong đó 0 nếu đó là búa, 1 nếu đó là kéo, 2 nếu đó là bao

Số a là ký hiệu hình bàn tay của bạn Bắc, số b là ký hiệu hình bàn tay của bạn Nam

OUTPUT:

·        Nếu bạn Bắc thắng thì đưa ra từ “BAC”.

·        Nếu bạn Nam thắng thì đưa ra từ “NAM”.

·        Nếu hai bạn hòa nhau thì đưa ra từ “HOA”.

·        Chú ý kết quả đưa ra là chữ in hoa.

Ví dụ:

INPUT

OUTPUT

0 0

HOA

0 1

BAC

1 0

NAM

Bài 4. Số chính phương                                                                  tên file: chinhphuong.***

Số chính phương là một số nguyên dương bằng bình phương của một số nguyên dương. Ví dụ: 1, 4, 9, 16, 100 … là những số chính phương; còn 3, 8, 15 … không phải là những số chính phương.

Cho trước một số nguyên dương n. Em hãy kiểm tra xem n có phải là số chính phương không?

Input: Một dòng duy nhất chứa số nguyên dương n.

Output: Đưa ra thông báo "yes" nếu n là số chính phương, ngược lại thông báo "no".

Ví dụ:

Input

Output

4

yes

8

no

Exercise 8
1 Helen said, "I think I'll have to find a better job. I can't make both ends meet."

-> Helen said she thought she would have to find a better job because she couldn't make both ends meet
2 He said to her "Why are you so late? I've been waiting for half an hour already."

->
3 She said to him: "Don't let them down. I'll be very embarrassed if you go back on your words."

->
4 She said to her husband: "You'd better not drink top much. You may lose control of the car and have a bad accident."

->
5 The boy said to his mother: "When shall we have lunch? I'm very hungry."

->
6 He said, "I don't understand why she has refused to join us on the trip."

->
7 She said to him, "I'm glad you've come. Sit down, please."

->
8 Mr Brown said to his wife, "I don't feel like going out this evening.”
Let's ask the Browns to come over for a chat."

->
9 “It's raining too hard to go out. We'd better stay home tonight and watch TV instead." John said.

->
10 "Could you ring up the station and find out when the train comes in?" said Tom to me.
->

Exercise 9
1 "Be careful. Don't go too near the edge of the cliff," she said to the boys.

->
2 "Please, please come to help me with the assignment," my friend said to me.

->
3 "I wouldn't buy that sort of raincoat if I were you," my friend said to me.

->
4 "Would you mind moving your bicycle?" said the janitor. "It's in the way."

->
5 "Could I take out another book, please," I said to the librarian.

->
6 "Remember to leave the window open when you're using the gas stove," my mother said to me.

->
7 "Wear your school badge or they won't let you into the classroom." my teacher said to me.

->
8 "Would you like to come over to my house for a slide show?" my
friend said to me.

->
9 "Show me your driver's licence, will you?" the policeman said to the drunken driver.

->
10 "Do come again next weekend," the host said to the visitor.

->

 

Exercise 8
1 Helen said, "I think I'll have to find a better job. I can't make both ends meet."

-> Helen said she thought she would have to find a better job because she couldn't make both ends meet
2 He said to her "Why are you so late? I've been waiting for half an hour already."

->
3 She said to him: "Don't let them down. I'll be very embarrassed if you go back on your words."

->
4 She said to her husband: "You'd better not drink top much. You may lose control of the car and have a bad accident."

->
5 The boy said to his mother: "When shall we have lunch? I'm very hungry."

->
6 He said, "I don't understand why she has refused to join us on the trip."

->
7 She said to him, "I'm glad you've come. Sit down, please."

->
8 Mr Brown said to his wife, "I don't feel like going out this evening.”
Let's ask the Browns to come over for a chat."

->
9 “It's raining too hard to go out. We'd better stay home tonight and watch TV instead." John said.

->
10 "Could you ring up the station and find out when the train comes in?" said Tom to me.
->

Exercise 9
1 "Be careful. Don't go too near the edge of the cliff," she said to the boys.

->
2 "Please, please come to help me with the assignment," my friend said to me.

->
3 "I wouldn't buy that sort of raincoat if I were you," my friend said to me.

->
4 "Would you mind moving your bicycle?" said the janitor. "It's in the way."

->
5 "Could I take out another book, please," I said to the librarian.

->
6 "Remember to leave the window open when you're using the gas stove," my mother said to me.

->
7 "Wear your school badge or they won't let you into the classroom." my teacher said to me.

->
8 "Would you like to come over to my house for a slide show?" my
friend said to me.

->
9 "Show me your driver's licence, will you?" the policeman said to the drunken driver.

->
10 "Do come again next weekend," the host said to the visitor.

->

2 He said to her "Why are you so late? I've been waiting for half an hour already."

->
3 She said to him: "Don't let them down. I'll be very embarrassed if you go back on your words."

->
4 She said to her husband: "You'd better not drink top much. You may lose control of the car and have a bad accident."


5 The boy said to his mother: "When shall we have lunch? I'm very hungry."


6 He said, "I don't understand why she has refused to join us on the trip."


7 She said to him, "I'm glad you've come. Sit down, please."


8 Mr Brown said to his wife, "I don't feel like going out this evening.”
Let's ask the Browns to come over for a chat."


9 “It's raining too hard to go out. We'd better stay home tonight and watch TV instead." John said.


10 "Could you ring up the station and find out when the train comes in?" said Tom to me.

Exercise 9
1 "Be careful. Don't go too near the edge of the cliff," she said to the boys.


2 "Please, please come to help me with the assignment," my friend said to me.


3 "I wouldn't buy that sort of raincoat if I were you," my friend said to me.


4 "Would you mind moving your bicycle?" said the janitor. "It's in the way."


5 "Could I take out another book, please," I said to the librarian.


6 "Remember to leave the window open when you're using the gas stove," my mother said to me.


7 "Wear your school badge or they won't let you into the classroom." my teacher said to me.


8 "Would you like to come over to my house for a slide show?" my
friend said to me.


9 "Show me your driver's licence, will you?" the policeman said to the drunken driver.


10 "Do come again next weekend," the host said to the visitor.