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.
uses crt;
var n:real;
begin
clrscr;
repeat
readln(n);
if (n<1) or (n>10) then writeln('Hay nhap lai');
until (1<=n) and (n<=10);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
string st;
int d,i,kt;
char x,ln;
int main()
{
getline(cin,st);
d=5;
x=st[2];
ln=st[0];
for (i=1; i<=d-1; i++)
if (ln<=st[i]) ln=st[i];
if (ln==x) cout<<"YES";
else cout<<"NO";
return 0;
}
program Le_Nho_Hon_Hoac_Bang_n;
uses crt;
var
n, i: integer;
begin
clrscr;
write('Nhap vao mot so nguyen duong n: ');
readln(n);
while n <= 0 do
begin
writeln('So ban nhap khong hop le. Xin vui long nhap lai: ');
readln(n);
end;
clrscr;
writeln('Cac so le nho hon hoac bang ', n, ' la:');
i := 1;
while i <= n do
begin
if i mod 2 <> 0 then
writeln(i);
i := i + 1;
end;
readln;
end.
Bài 1:
uses crt;
var n,i,s:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+i;
inc(i);
end;
writeln('Tong cac so trong khoang tu 1 den ',n,' la: ',s);
readln;
end.
Bài 2:
uses crt;
var n,i,s:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+i;
i:=i+2;
end;
writeln('Tong cac so le trong khoang tu 1 den ',n,' la: ',s);
readln;
end.
program Tong_Binh_Phuong_So_Chan;
uses crt;
var n, i, sum: integer;
begin
clrscr;
write('Nhap vao so nguyen n (6 < n < 30): ');
readln(n);
sum := 0;
for i := 2 to n do
if i mod 2 = 0 then
sum := sum + i * i;
writeln('Tong binh phuong cac so chan tu 1 den ', n, ' la: ', sum);
readln;
end.
program TimBoi4ChuSo;
var
n, i: integer;
begin
repeat
writeln('Nhap vao so nguyen n (2<n<100): ');
readln(n);
until (n > 2) and (n < 100);
writeln('Cac boi cua ', n, ' co 4 chu so la: ');
for i := 1000 to 9999 do
begin
if i mod n = 0 then
writeln(i);
end;
end.
program MultiplesOfN;
var
n, i: integer;
begin
repeat
write('Nhap vao so nguyen duong n (0<n<100): ');
readln(n);
until (n > 0) and (n < 100);
writeln('Cac boi so cua ', n, ' co 4 chu so la:');
for i := 1000 to 9999 do
begin
if (i mod n = 0) then
begin
writeln(i);
end;
end;
readln;
end.
uses crt;
var x:real;
begin
clrscr;
repeat
write('Nhap diem:'); readln(x);
until (0<=x) and (x<=10) and ((frac(x)=25) or (frac(x)=5) or (frac(x)=75) or (frac(x)=0));
writeln(x:4:2);
readln;
end.
Program hotrotinhoc_hoc24;
var n: integer;
begin
write('Nhap so : '); readln(n);
while (n>=10) or (n<=1) do
begin
write('Nhap lai so : '); readln(n);
end;
readln
end.