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.
program;
uses crt;
var a:longint;
begin
clrscr;
write('nhap a:');readln(a);
if(a>=0)and(a<=50)then write('n nam trong khoang tu 1 den 50')
else write('n khong nam trong khoang tu 1 den 50');
readln;
#include <bits/stdc++.h>
using namespace std;
int a;
int main()
{
cin>>a;
if ((a>=1) and (a<=50)) cout<<"YES";
else cout<<"NO";
return 0;
}
#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;
}
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 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.
uses crt;
var i,n,kt:integer;
begin
clrscr;
readln(n);
kt:=0;
for i=2 to trunc(sqrt(n)) do
if n mod i=0 then kt:=1;
if (kt=0) and (n>1) then write('phai')
else write('Khong phai');
readln;
end.
Var i,n,souoc:integer;
Begin
While n <= 1 do
Begin
Write('Nhap n = ');readln(n);
End;
For i:=1 to n do
If n mod i = 0 then souoc:=souoc+1;
If souoc = 2 then write(n,' la so nguyen to')
Else write(n,' khong la so nguyen to');
Readln;
End.
Program HOC24;
var n: real;
begin
write('Nhap so thuc : '); readln(n);
while (n>=1) and (n>=5) do
begin
write('So khong nam trong khoang 1 den 5, nhap lai :');
readln(n);
end;
readln
end.