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.
Program bai1;
uses crt;
var dem,n,i: integer;
begin
clrscr;
write('nhap n ='); readln(n);
dem:=0;
for i:= 1 to n do
if i mod 2 = 1 then
begin
write(i:3,',');
dem:= dem+1 ;
if dem mod 15 = 0 then writeln;
end;
readln;
end.
1.
Program bai1;
uses crt;
var n,i: integer;
begin
clrscr;
write('nhap so n ='); readln(n);
for i := 1 to n do
if n mod i = 0 then
write(i :2 , ' , ');
readln;
end.
2.
program bai2;
uses crt;
var i,n: integer;
begin
clrscr;
write('nhap so n ='); readln(n);
for i: 1 to n do
if i mod 2 = 0 then
write(i: 3 ,',');
readln;
end.
uses crt;
var a:array[1..250]of integer;
i,n,min,vt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
min:=a[1];
for i:=1 to n do
if min>a[i] then min:=a[i];
for i:=1 to n do
if min=a[i] then vt:=i;
writeln('So nho nhat la: ',min,' va o vi tri thu ',vt);
readln;
end.
Bài 1:
Program hotrotinhoc;
var i,n: integer;
t: longint;
begin
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
for i:=1 to n do
begin
write(a[i],' ');
if a[i] mod 2=1 then t:=t+a[i];
end;
writeln;
write(t);
readln
end.
Bài 2:
Program hotrotinhoc;
var i,n,t: integer;
begin
write('n='); readln(n);
for i:=1 to n do
begin
write('Nhap diem Toan cua ban thu ',i,': '); readln(a[i]);
end;
for i:=1 to n do
begin
writeln('Diem toan cua ban thu ',i,' la :',a[i]);
if a[i] >=8 then t:=t+1;
end;
write('So hoc sinh co diem toan la 8 tro len la :', t);
readln
end.
Bài 3:
Program hotrotinhoc;
var i,n,k: integer;
a:array[1..32000] of string;
begin
write('Nhap k='); readln(k);
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
a[k]:='NO';
for i:=1 to n do
if a[i]<>'NO' then write(a[i],' ');
readln
end.
Bài 4:
Program hotrotinhoc;
var min,i,n,vt: integer;
a:array[1..32000] of integer;
begin
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
min:=32000;
for i:=1 to n do
if a[i]<min then
begin
min:=a[i];
vt:=i;
end;
write('So nho nhat trong day la so thu ',vt);
readln
end.
b) uses crt;
var a:array[1..100,1..100]of integer;
n,i,j:integer;
begin
clrscr;
write('nhap n='); readln(n);
for i:=1 to n do
for j:=1 to n do
begin
write('a[',i,',',j,']='); readln(a[i,j]);
end;
for i:=1 to n do
begin
for j:=1 to n do
write(a[i,j]:4);
writeln;
end;
readln;
end.
uses crt;
var a:array[1..255]of integer;
i,n,k,kt:integer;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
write('Nhap k='); readln(k);
kt:=0;
for i:=1 to n do
if a[i]=k then kt:=1;
if kt=0 then writeln(k,' khong co trong day')
else writeln(k,' co trong day');
readln;
end.
\(\dfrac{s}{13}=\dfrac{2s}{3-vn}+\dfrac{2s}{3+vn}\)
\(\dfrac{s}{13}=\dfrac{2s\left(3+vn\right)+2s\left(3-vn\right)}{9-vn^2}\)
\(\dfrac{s}{13}=\dfrac{12s}{9-vn^2}\)
\(s\left(9-vn^2\right)=12s\cdot13\)
\(s\left(9-vn^2\right)=156s\)
\(9-vn^2=156\)
\(vn^2=-147\)
a)
Input: Số nguyên dương N, dãy số a1,a2,a3,...,an
Output: Tổng các số chẵn nhỏ hơn hoặc bằng N
b)
Program HOC24;
var i,n: integer;
t: longint;
a: array[1..1000] of integer;
f1,f2: text;
const fi='SONGUYEN.TXT';
fo='SOCHAN.TXT';
begin
assign(f1,fi);
assign(f2,fo);
reset(f1);
rewrite(f2);
readln(f1,n);
for i:=1 to n do read(f1,a[i]);
for i:=1 to n do if (a[i] mod 2=0) and (a[i]<=n) then
begin
write(f2,a[i],' ');
t:=t+a[i];
end;
writeln(f2);
write(f2,t);
close(f1); close(f2);
end.
1.
Program bai1;
uses crt;
var i,n: integer;
begin
clrscr;
write('nhap so n ='); readln(n);
i:=1;
while i<=n do
begin
write(i:3,', ');
i:=i+2;
end;
readln;
end.
2.
Program bai2;
uses crt;
var i,n,nhonhat: integer;
a: array[1..100] of real;
min: real;
begin
clrscr;
write('nhap n :='); readln(n);
for i:= 1 to n do
begin
write('a[',i,'] = '); readln(a[i]);
end;
min:=a[1];
nhonhat:=1;
for i:= 2 to n do
if a[i] < min then
begin
min:=a[i];
nhonhat:=i;
end;
writeln('phan tu nho nhat la phan tu thu ' ,nhonhat);
readln;
end.
{ https://www.facebook.com/profile.php?id=100022887573679 }