K
Khách

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.

Câu 1: 

uses crt;

var xa,ya,xb,yb,xc,yc,p,s,ab,bc,ac:real;

begin

clrscr;

readln(xa,ya,xb,yb,xc,yc);

ab:=sqrt(sqr(xa-xb)+sqr(ya-yb));

ac:=sqrt(sqr(xa-xc)+sqr(ya-yc));

bc:=sqrt(sqr(xb-xc)+sqr(yb-yc));

p:=(ab+bc+ac)/2;

s:=sqrt(p*(p-ab)*(p-ac)*(p-bc));

writeln('Chu vi la: ',p*2:4:2);

writeln('Dien tich la: ',s:4:2);

readln;

end.

3 tháng 11 2021

e cảm ơn ạ

 

27 tháng 10 2021

#inclue <bits/stdc++.h>

using namespace std;

double a;

int main()

{

cin>>a;

if (a<=0) cout<<"khong phai";

else cout<<fixed<<setprecision(2)<<a*a;

return 0;

}

31 tháng 10 2021

code bằng python

a = input('nhap a ')

if a>0:

    print('a la canh cua hinh vuong. Dien tich S = ', a**2)

else:

    print('a khong phai la canh hinh vuong')

5 tháng 5 2023

s = input("Nhập một xâu bất kỳ: ")

print("Các ký tự và chữ số trong xâu là:")

for char in s:

       if char.isdigit() or char.isalpha():

              print(char)

6 tháng 5 2023

Cho mình hỏi isalpha là gì vậy ạ ?

#include <bits/stdc++.h>

using namespace std;

long long m,n;

int main()

{

cin>>m>>n;

if (m%n==0) cout<<m/n;

else if (n%m==0) cout<<n/m;

else cout<<m+n;

return 0;

}

uses crt;
var a:array[1..100]of longint;
i,n,t,t1,tam,j:integer;
s,s1:int64;
begin
clrscr;
repeat
write('nhap n='); readln(n);
until n>0;
for i:=1 to n do
begin
repeat
write('a[',i,']='); readln(a[i]);
until a[i]>=0;
end;
writeln('Mang A=');
for i:=1 to n do
write(a[i]:4);
writeln;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('Tong gia tri cua mang A la: ',t);
s:=1;
for i:=1 to n do
s:=s*i;
writeln('Tich cac gia tri cua mang A la: ',s);
t1:=0;
for i:=1 to n do
if i mod 2=0 then t1:=t1+a[i];
writeln('Tong cac gia tri o vi tri chan la: ',t1);
s1:=1;
for i:=1 to n do
if i mod 2<>0 then s1:=s1*a[i];
writeln('Tich cac gia tri o vi tri le la: ',s1);
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]>a[j] then
begin
tam:=a[i];
a[i]:=a[j];
a[j]:=tam;
end;
writeln('Mang A sau khi sap xep la: ');
for i:=1 to n do
write(a[i]:4);
writeln;
writeln('Cac phan tu co gia tri lon hon 10 la: ');
for i:=1 to n do
if a[i]>10 then write(a[i]:4);
readln;
end.

13 tháng 5 2020

Vâng c.on ạ

uses crt;

var a:array[1..300]of integer;

i,n,dem,kt,t:integer;

begin

clrscr;

write('Nhap n='); readln(n);

for i:=1 to n do 

  begin

write('A[',i,']='); readln(a[i]);

end;

dem:=0;

for i:=1 to n do 

  if a[i] mod 3=0 then inc(dem);

t:=abs(a[2]-a[1]);

kt:=0;

for i:=1 to n do 

if t<>abs(a[i]-a[i-1]) then 

begin

kt:=1;

break;

end;

if kt=0 then writeln('Day la cap so cong')

else writeln('Day khong la cap so cong');

readln;

end.

const fi='songuyen.txt';

fo='ketqua.txt';

var f1,f2:text;

a:array[1..100]of integer;

n,i,t:integer;

begin

assign(f1,fi); reset(f1);

assign(f2,fo); rewrite(f2);

n:=0;

while not eoln(f1) do

begin

inc(n);

read(f1,a[n]);

end;

t:=0;

for i:=1 to n do

if a[i]>0 then t:=t+a[i];

writeln(f2,t);

close(f1);

close(f2);

end.

21 tháng 5 2020

đây là tìm số nguyên trong khoảng từ 1.. 100 mà

bucminh

17 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long n,i,a[10000];

int main()

{

cin>>n;

for (i=1; i<=n; i++)

cin>>a[i];

for (i=1; i<=n; i++)

cout<<a[i]<<" ";

}

24 tháng 12 2021

lớp 11 sao mà khác vậy