Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
1:
uses crt;
var a:array[1..100]of integer;
i,n,max:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.
2:
uses crt;
var s:real;
i:integer;
begin
clrscr;
s:=0;
for i:=1 to 100 do
s:=s+1/i;
writeln(s:4:2);
readln;
end.
Câu 6:
uses crt;
var n,i:integer;
begin
clrscr;
readln(n);
for i:=1 to n do
if n mod i=0 then write(i:4);
readln;
end.
5:
uses crt;
var n,i,dem:integer;
begin
clrscr;
readln(n);
dem:=0;
for i:=0 to n do
if i mod 2=1 then
begin
write(i:4);
dem:=dem+1;
end;
writeln;
writeln(dem);
readln;
end.
Program bt_1;
Uses crt;
Var Tong, n, i: integer;
Begin
Clrscr;
Writeln(‘nhap n=’);
Readln (n);
Tong:=0;
For i:=1 to n do
If I mod 2 = 1 then Tong:= Tong+i;
Writeln(‘Tong la:’,Tong);
Readln
End.
Program tinhtong;
uses crt;
var i, SUM, N : integer;
Begin
Clrscr;
Write('Nhap N: '); Readln(n);
SUM := 0; For i:=1 to N do if (i mod 3 = 0) then SUM:= SUM + i;
Write('Tong la: ', SUM);
Readln;
End.
Uses crt;
var i,t: integer;
begin clrscr;
i:=0;
while(i<=120) do begin
i:=i+1;
t:=t+i;
end;
write(t);
readln;
end.
https://hoc247.net/hoi-dap/toan-6/tinh-1-1-2-1-3-1-4-1-100-faq172796.html
Program HOC24;
var i: byte;
t: real;
begin
t:=0;
for i:=1 to 100 do t:=t+1/i;
write('T= ',t:5:2);
readln
end.