Bài 4: Viết chương trình thực hiện : nhập CD và CR từ bàn phím. Kiểm tra nếu CD và CR > 0 thì tính và in lên màn hình diện tích hình chữ nhật. Bài 6: Viết chương trình nhập vào số ngày thuê phòng khách sạn, loại phòng (A, B, C). - phòng loại A : 300000/ngày - phòng loại B : 250000/ngày - phòng loại C : 200000/ngày Tính tiền và xuất ra có quy cách. Bài 7: Viết chương trình tính tiền thuê sách: - Nhập : số cuốn, số ngày, giá Tính tiền = số ngày * số cuốn * giá . Nếu số ngày >5 thì giảm 2000 ngược lại không giảm. Xuất ra có quy cách 10:2. viết chương trình thực hiện một số m từ bàn phím ,kiểm tra và thông báo m có chia hết cho 5 ko bài 2 viết chương trình thực hiện nhập a từ bàn phím ,kiểm tra nếu a>0 thì tính và in lên màn hình diện tích hình vuông cso cạch bằng a giúp em với ạ

1 câu trả lời

Bài 4:

Program FNG;
Uses crt;
Var CD,CR,s: extended;
Begin
        Clrscr;
        Write('Nhap CD, CR: '); Readln(CD,CR);
        If (CD>0) and (CR>0) then s:=CD*CR;
        Write(S:0:2);
        Readln
End.

Bài 6:

Program FNG;
Uses crt;
Var ngay,tien: qword;
    phong: char;
Begin
        Clrscr;
        Write('Nhap so ngay: '); Readln(ngay);
        Write('Nhap phong: '); Readln(phong);
        If (phong='A') or (Upcase(phong)='A') then tien:=ngay*300000;
        If (phong='B') or (Upcase(phong)='B') then tien:=ngay*250000;
        If (phong='C') or (Upcase(phong)='C') then tien:=ngay*200000;
        Write('Gia tien cua phong ',phong,' trong thoi gian ',ngay,' ngay la ',tien);
        Readln
End.

Câu hỏi trong lớp Xem thêm

II. Choose the word or phrase that best completes each unfinished sentence below. 6. Radioactive pollution is increasing the increased use of radioactivity. A. as B. since C. because of D. because 7. Do you think there would be less conflict in the world if all people the same language? A. spoke B. speak C. had spoken D. will speak 8. Unless you all of my questions, I can’t do anything to help you. A. answered B. answer C. would answer D. are answering 9. Singapore is famous for its …………. streets and green trees. A. cleanliness B. cleanly C. cleaning D. clean 10. If someone into the store, smile and say, “May I help you?” A. comes B. came C. come D. should come 11. It was said that the fish died a powerful toxin in the sea water. A. because of B. because C. since D. as a result 12. “Here’s my phone number”. “Thanks. I’ll give you a call if I some help tomorrow” A. will need B. need C. would need D. needed 13. is the festival celebrated? – Every year. A. When B. How often C. How D. What 14. The death rate would decrease if hygienic conditions improved. A. was B. is C. were D. had been 15. On Christmas Eve, most big cities, especially London are _______ with coloured lights across the streets and enormous Christmas trees. A. decorated B. hang C. put D. made 16. If she him, she would be very happy. A. would meet B. will meet C. met D. should meet 17. Nga is a beautiful girl; ______ , she’s kind - hearted. A. therefore B. however C. moreover D. otherwise 18. If I had enough money, I abroad to improve my English. A. will go B. would go C. went D. should have go to 19. She has read interesting book. A. a B. an C. the D. Ø 20. If it convenient, let’s go out for a drink tonight. A. be B. is C. was D. were

9 lượt xem
1 đáp án
14 giờ trước