Những câu hỏi liên quan
concugia
Xem chi tiết
minh nguyen cong
Xem chi tiết
Minh Lệ
21 tháng 4 2019 lúc 8:45

Lời giải :

program hotrotinhoc ;

var a: array[1..32000] of integer ;

i,n,max : integer ;

begin

write('Nhap n='); readln(n);

writeln('Nhap gia tri cua cac phan tu');

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];

write('So lon nhat la:',max');

readln

end.

Mikako Tomoko
Xem chi tiết
nguyễn thị lê
Xem chi tiết
Kiều Vũ Linh
9 tháng 5 2023 lúc 16:14

var s,i,n:integer;

begin

Write('n = ');

While (n > 100) and (n < 1) then

Begin

write('Nhap sai, nhap lai ');readln(n);

End;

for i:=1 to n do

s:=s+i;

write('tong la: ',s);

readln;

end.

Nguyễn Thái Sơn
Xem chi tiết
Nguyễn Lê Phước Thịnh
12 tháng 12 2021 lúc 14:48

#include <bits/stdc++.h>

using namespace std;

string s1;

int d,i;

int main()

{

getline(cin,s1);

d=s1.length();

for (i=0; i<=d-1; i++)

if ((s1[i]>=48) and (s1[i]<=57)) cout<<s1[i];

return 0;

}

Đoàn Duyên Thảo Vi
Xem chi tiết
Vy Tuong
Xem chi tiết
Nguyễn Lê Phước Thịnh
4 tháng 6 2020 lúc 12:41

uses crt;

var n,i:integer;

begin

clrscr;

repeat

write('Nhap n='); readln(n);

until n>0;

write('Cac so chan trong khoang tu 1 toi ',n,' la: ');

for i:=1 to n do

if i mod 2=0 then write(i:4);

readln;

end.

Vy Tuong
4 tháng 6 2020 lúc 12:47

giup mik vs mik dg can gap.

vothedien
4 tháng 6 2020 lúc 14:43

program so_tu_nhien_chan;

uses crt;
var n,i:integer;
begin
clrscr;
write('Nhap n='); readln(n);
write('Cac so chan nho hon hoac bang ',n,' la: ');
for i:=2 to n do
if i mod 2=0 then write(i:4,' ;');
readln;
end.

nguyen trinh
Xem chi tiết
Nguyễn Lê Phước Thịnh
27 tháng 6 2020 lúc 10:21

uses crt;
var a,b:array[1..100]of integer;
n,i,dem,max,tam,j:integer;
begin
clrscr;
repeat
write('Nhap n='); readln(n);
until (0<n) and (n<=100);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
writeln('Cac so chia het cho 4 la: ');
for i:=1 to n do
if a[i] mod 4=0 then write(a[i]:4);
writeln;
dem:=0;
for i:=1 to n do
if a[i] mod 7=0 then
begin
inc(dem);
b[dem]:=a[i];
end;
max:=b[1];
for i:=1 to dem do
if max<b[i] then max:=b[i];
writeln('So lon nhat chia het cho 7 la: ',max);
writeln('Cac chi so cua no trong day A la: ');
for i:=1 to n do
if max=a[i] then write(i:4);
writeln;
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]<a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('Day so sau khi sap xep giam dan la: ');
for i:=1 to n do
write(a[i]:4);
readln;
end.

Cô nàng song tử
Xem chi tiết
nu hoang tu do
22 tháng 11 2017 lúc 18:41

1,2345678

2,4357656

3,3456543

4,4963476

5,8632549

đúng thì k nha