1. Viết chương trình in ra màn hình các số đếm từ 1 đến 20, mỗi số in trên một dòng. 2. Viết chương trình in ra màn hình các số đếm từ 20 đến 10, mỗi số in trên một dòng. 3. Viết chương trình nhập vào N số nguyên từ bàn phím. Tính và in ra màn hình tổng của các số vừa nhập vào. 4. Viết chương trình nhập vào số nguyên N từ bàn phím. In ra màn hình các ước của N.

2 câu trả lời

Câu 1 :

uses crt;

var i : byte;

begin

clrscr;

for i := 1 to 20 do writeln(i);

readln

end.

Câu 2 :

uses crt;

var i : byte;

begin

clrscr;

for i := 20 downto 10 do writeln(i);

readln

end.

Câu 3 :

uses crt;

var i, N, S : integer;

begin

clrscr;

write('Nhap so N : '); readln(N);

S := 0;

for i := 1 to N do S := S + i;

write('S = ', S);

readln

end.

Câu 4 :

uses crt;

var i, N : integer;

begin

clrscr;

write('Nhap so N : '); readln(N);

for i := 1 to N do

if N mod i = 0 then write(i,'  ');

readln

end.

1/

Program BTH;
uses crt;
var i:byte;
Begin
        clrscr;
        For i:=1 to 20 do
                writeln(i);
        readln;
end.

2/

Program BTH;
uses crt;
var i:byte;
Begin
        clrscr;
        For i:=20 downto 10 do
                writeln(i);
        readln;
end.

3/

Program BTH;
uses crt;
var n,i,s,k:longint;
Begin
        clrscr;
        write('Nhap n: ');readln(n);
        For i:=1 to n do
        Begin
                write('Nhap so thu ',i,' : ');readln(k);
                s:=s+k;
        end;
        writeln('Tong day so tren la: ',s);
        readln;
end.

4/

Program BTH;
uses crt;
var n,i:longint;
Begin
        clrscr;
        write('Nhap n: ');readln(n);
        writeln('Uoc cua ',n,' la: ');
        For i:=1 to n do
        Begin
                If n mod i=0 then write(i,' ');
        end;
        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

7 lượt xem
1 đáp án
4 giờ trước