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 dai,rong:integer;
Procedure Nhap(Var dai:integer;rong:integer);
Begin
Write('Chieu dai: ');readln(dai);
Write('Chieu rong: ');readln(rong);
End;
Procedure Ve(var dai:integer;rong:integer);
var i,j:integer;
Begin
for i:= 1 to dai do write('*');writeln;
For i:= 1 to rong-2 do
Begin
Write('*');
for j:=1 to dai-2 do write(' ');
writeln('*');
end;
for i:= 1 to dai do write('*');
End;
Begin
clrscr;
Nhap(dai,rong);
Ve(dai,rong);
readln;
End.
uses crt;
const fi='baitap.txt';
var f1:text;
a,b:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,a,b);
writeln('Chu vi hinh chu nhat la: ',(a+b)*2);
close(f1);
readln;
end.
uses crt;
const fi='baitap.txt';
var f1:text;
a,b:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,a,b);
writeln('Chu vi la: ',(a+b)*2);
writeln('Dien tich la: ',a*b);
close(f1);
readln;
end.
Tham khảo
program hcn;
uses crt;
var d,r,dt:longint;
cv:real;
begin
write('nhap chieu dai va chieu rong cua hcn:');
readln(d,r);
cv:=(d+r)*2;
dt:=d*r;
writeln(' chu vi hcn do la:',cv);
writeln(' dien tich hcn do la:',dt);
readln
end.
uses crt;
var a,b,i,j:integer;
st:string;
begin
clrscr;
repeat
write('Ban muon ve khong:'); readln(st);
if st='Yes' then
begin
write('Nhap chieu dai:'); readln(a);
write('Nhap chieu rong:'); readln(b);
for i:=1 to a do
begin
for j:=1 to b do
write('*');
writeln;
end;
end
else break;
until st='No';
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<(a+b)*2<<endl;
cout<<a*b;
return 0;
}
uses crt;
var a,b:integer;
{-----------------chuong-trinh-con-tinh-chu-vi----------------------------------}
function cv(x,y:integer):integer;
begin
cv:=x+y;
end;
{-------------------chuong-trinh-con-tinh-dien-tich-----------------------------}
function dt(x,y:integer):integer;
begin
dt:=x*y;
end;
{-------------------------chuong-trinh-chinh-------------------------}
begin
clrscr;
write('Nhap chieu dai:'); readln(a);
write('Nhap chieu rong:'); readln(b);
writeln('Chu vi la: ',cv(a,b));
writeln('Dien tich la: ',dt(a,b));
readln;
end.
uses crt;
var a,b:integer;
{---------------ve-hinh-chu-nhat---------------------}
procedure ve(x,y:integer);
var i,j:integer;
begin
for i:=1 to x do
begin
for j:=1 to y do
write('*');
writeln;
end;
end;
{------------------chuong-trinh-chinh---------------}
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
ve(a,b);
writeln;
ve(2*a,2*b);
writeln;
ve(3*a,3*b);
readln;
end;