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.
1/
program uoc;
uses crt;
var n,i,dem,x:word;
a:array[1..20] of longint;
begin
clrscr;
write('nhap so phan tu cua day:') ;readln(n);
while n>20 do
begin
write('nhap lai so phan tu thoa man toi da la 20 phan tu:');
readln(n);
end;
writeln('nhap cac phan tu cua mang:');
for i:=1 to n do
begin
write('a[',i,']='); readln(a[i]);
end;
write('nhap so nguyen x:'); readln(x);
dem:=0;
for i:=1 to n do
if x mod a[i] =0 then
begin
dem:=dem+1;
writeln(a[i],' la uoc cua ',x);
end;
if dem=0 then writeln('khong co phan tu la uoc cua ',x)
else write('co ',dem,' phan tu la uoc cua ',x);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double a,s;
int main()
{
cin>>a;
s=1/2*a*a;
cout<<fixed<<setprecision(2)<<s;
return 0;
}
uses crt;
const fi='kiemtra.txt';
var f1:text;
a:array[1..100]of integer;
min,n,i:integer;
{----------------chuong-trinh-con-------------------}
function nn(x,y:integer):integer;
begin
if x<y then nn:=x
else nn:=y;
end;
{-----------------chuong-trinh-chinh-----------------}
begin
clrscr;
write('nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
min:=nn(a[1],a[2]);
for i:=3 to n do
if min>a[i] then min:=a[i];
writeln(min);
readln;
end.
Mình xin sửa lại một chút:
uses crt;
const fi='kiemtra.txt';
var f1:text;
a:array[1..100]of integer;
min,n,i:integer;
{----------------chuong-trinh-con-------------------}
function nn(x,y:integer):integer;
begin
if x<y then nn:=x
else nn:=y;
end;
{-----------------chuong-trinh-chinh-----------------}
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
min:=nn(a[1],a[2]);
for i:=3 to n do
if min>a[i] then min:=a[i];
writeln(min);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
double a,s;
int main()
{
cin>>a;
s=1/2*a*a;
cout<<fixed<<setprecision(2)<<s;
return 0;
}
uses crt;
var a,b:integer;
{-----------------chuong-trinh-con-------------------}
function ucln(x,y:integer):integer;
var i,uc:integer;
begin
if x<y then
begin
uc:=1;
for i:=1 to x do
if (x mod i=0) and (y mod i=0) then
begin
if uc<i then uc:=i;
end;
end
else begin
uc:=1;
for i:=1 to y do
if (x mod i=0) and (y mod i=0) then
begin
if uc<i then uc:=i;
end;
end;
ucln:=uc;
end;
{--------------------------chuong-trinh-chinh------------------------}
begin
clrscr;
write('Nhap a='); readln(a);
write('Nhap b='); readln(b);
writeln(a,'/',b,'=',a div ucln(a,b),'/',b div ucln(a,b));
readln;
end.
phynit thầy giúp e với
program bai1;
var
begin
write('Ten cua ban la ');readln(ten);
write('Nam hien tai la ');readln(nht);
write('Nhap nam sinh ');readln(ns);
write('Ban hoc lop ');readln(lop);
tuoi:=nht-ns;
writeln('Ten cua ban la ',tuoi);
readln
end.