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 st:string;
d,i:integer;
begin
clrscr;
readln(st);
d:=length(st);
for i:=1 to d do
if not (st[i] in ['0'..'9']) then write(st[i]);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int main() {
double a, b, c, S;
cin >> a >> b;
S=(1.0/2)*a*b;
c=sqrt(a*a+b*b);
cout << fixed << setprecision(2) << "Dien tich la " << (double)S << "\nCanh huyen la " << (double)c << endl;
return 0;
}
Chúc bn học tốt!
1:
uses crt;
const fi='ketqua.txt';
var f1:text;
st:string;
i,d:integer;
begin
clrscr;
assign(f1,fi); rewrite(f1);
write('Nhap xau:'); readln(st);
d:=length(st);
for i:=1 to d do
if st[i]=#32 then delete(st,i,1);
writeln(f1,st);
close(f1);
end.
2:
uses crt;
var a,b,c,d:integer;
{----------chuong-trinh-con-----------------------}
function min(x,y:integer):integer;
begin
if x<y then min:=x
else min:=y;
end;
{---------------chuong-trinh-chinh--------------------}
begin
clrscr;
write('a='); readln(a);
write('b='); readln(b);
write('c='); readln(c);
write('d='); readln(d);
writeln(min(a,min(b,min(c,d))));
readln;
end.
Bài 5:
#include <bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<(a+b)*2;
return 0;
}
1.uses crt;
var n,gt:longint;
begin
clrscr;
repeat
write('nhap so n:');readln(n);
until n>0;
gt:=1;
while n>0 do
begin
gt:=gt*n;
n:=n-1;
end;
writeln('giai thua cua n la:',gt);
readln
end.
2. uses crt;
var a,b,c:real;
begin
clrscr;
write('nhap a=');readln(a);
write('nhap b=');readln(b);
write('nhap c=');readln(c);
if (a*a=b*b+c*c) or (b*=c*c+a*a) or (c*c=a*a+b*b) then writeln('khong phai la tam giac vuong');
readln
end.
Câu 1:
uses crt;
var st:string;
d,i,dem:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
write('Xau sau khi xoa so la: ');
for i:=1 to d do
if not(st[i] in ['0'..'9']) then write(st[i]);
writeln;
dem:=0;
for i:=1 to d do
if st[i]=#32 then inc(dem);
writeln('Xau co ',dem,' dau cach');
writeln('Do dai cua xau la: ',d);
readln;
end.
Câu 2:
uses crt;
const fi='kq.out';
var st1,st2:string;
f1:text;
begin
clrscr;
write('Nhap xau thu 1:'); readln(st1);
write('Nhap xau thu 2:'); readln(st2);
assign(f1,fi); rewrite(f1);
if length(st2)>length(st1) then writeln(f1,st2)
else writeln(f1,st1);
close(f1);
end.
#include <bits/stdc++.h>
using namespace std;
string st1,st2;
int d1,d2;
int main()
{
cin>>st1>>st2;
d1=st1.length();
d2=st2.length();
if (d1<d2) cout<<st1;
else cout<<st2;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
double a;
int main()
{
cin>>a;
cout<<fixed<<setprecision(2)<<a*a;
return 0;
}
program hinhvuong;
uses crt;
var a,s:real;
begin
clrscr;
write('Nhap do dai canh a: ');
readln(a);
if (a>0) then
begin
s:=a*a;
write('Dien tich hinh vuong do la: ',s:1:2);
end;
readln;
end.