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 HOC24;
var i: byte;
s: string;
begin
readln(s);
for i:=1 to length(s) do
begin
if s[i]='1' then write('mot ');
if s[i]='2' then write('hai ');
if s[i]='3' then write('ba ');
if s[i]='4' then write('bon ');
if s[i]='5' then write('nam ');
if s[i]='6' then write('sau ');
if s[i]='7' then write('bay ');
if s[i]='8' then write('tam ');
if s[i]='9' then write('chin ');
if s[i]='0' then write('khong ');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
if (n%2==0) cout<<"Chan";
else cout<<"Le";
return 0;
}
uses crt;
var n,i,d,max,x,y:integer;
st:string;
begin
clrscr;
write('Nhap n='); readln(n);
str(n,st);
d:=length(st);
max:=0;
for i:=1 to d do
begin
val(st[i],x,y);
if max<x then max:=x;
end;
writeln(max);
readln;
end.
program tong;
uses crt;
var M, N, S, i: integer;
begin
clrscr;
write ('Nhap M= '); readln(M);
write ('Nhap N= '); readln(N);
s : = 0;
for i := M to N do if (i mod 2 = 0) then s:= s + i;
write (T'ong cac so chan trong pham vi tu M den N = ',s);
readln;
end.
mk mới làm tổng thui nghen
var A:
array[1..n] of int64;
i, n, count: integer;
begin
write('Nhap so phan tu cua mang: ');
readln(n);
for i := 1 to n do
begin
write('Nhap phan tu thu ', i, ': ');
readln(A[i]);
end;
count := 0;
for i := 1 to n do
if A[i] > 0 then
count := count + 1;
writeln('So luong cac so nguyen duong trong mang la: ', count); end.
Var a,b:real;
Begin
Write('a = ');readln(a);
Write('b = ');readln(b);
If a > b then write('So lon la ',a:10:2)
Else if b > a then write('So lon la ',b:10:2)
Else write('Hai so bang nhau');
Readln;
End.
Program solonhon;
var a,b: integer;
begin
write('Nhap a: '); readln(a);
write('Nhap b: '); readln(b);
if a> b then write(a);
if a<b then write(b);
if a=b then write('2 so bang nhau');
readln
end.
uses crt;
var n,i,o,d:integer;
function ktnt(n:integer): integer;
var i,d:integer;
begin
d:=0;
for i:=1 to sqrt(n) do
if (n mod i=0) then d:=d+1;
if d=2 then ktnt=0
else ktnt=1;
end;
begin
readln(n);
writeln(' so nguyen to be hon hoac bang n la'); {a}
for i:=1 to n do
if ktnt(i)=0 then writeln(i);
writeln('so nguyen to nho nhat khong be hon n');
o:=n;
while o>0 do
begin
if ktnt(o)=0 then
begin
write(o);
break;
end;
o:=o+1;
end;
writeln('cặp số nguyên tố là hai số nguyên lẻ liên tiếp nhỏ hơn hoặc bằng n');
o:=0;
o:=1;
d:=0;
for i:=o+2 to n do
begin
if ktnt(i)=0 then
begin
d:=d+1;
write(i,' ');
if d<2 then continue;
end;
d:=0;
writeln;
end;
readln;
end.
Bài 1:
uses crt;
var cd,cr,i,j:integer;
begin
clrscr;
write('chieu dai='); readln(cd);
write('chieu rong='); readln(cr);
if (cd>0) and (cr>0) and (cd>=cr) then
begin
for i:=1 to cr do
begin
for j:=1 to cd do
write('*');
writeln;
end;
end
else writeln('vui long nhap lai');
readln;
end.
Bài 2:
uses crt;
var a,s,dem:integer;
begin
clrscr;
s:=0;
dem:=0;
repeat
write('nhap so a:'); readln(a);
s:=s+a;
dem:=dem+1;
until a=0;
writeln('tong cua cac so da nhap la: ',s);
writeln('trung binh cong cua cac so da nhap la: ',s/dem:4:2);
readln;
end.
Bài 3:
uses crt;
var i:integer;
begin
clrscr;
writeln('bang tinh can bac 2 cua 100 so nguyen duong dau tien la: ');
for i:=1 to 100 do
begin
write('can bac 2 cua ',i,' la: ');
writeln(sqrt(i):4:2);
end;
readln;
end.