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.

19 tháng 12 2021

Bài 3: 

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<a%b;

cout<<a/b;

return 0;

}

19 tháng 12 2021

2:

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<a%b<<endl;

cout<<a/b;

return 0;

}

30 tháng 11 2021

Tham khảo: 

program tam_giac;

uses crt;

var a,b,c,p,S:real;

begin

clrscr;

write('nhap canh a:'); readln(a);

write('nhap canh b:'); readln(b);

write('nhap canh c:'); readln(c);

p:=(a+b+c)/2;

S:=(p*(p-a)*(p-b)*(p-c));

writeln('dien tich hinh tam giac la:',S:10:2);

readln;

end.

30 tháng 11 2021

box sinh đi chớ ;-;

2: 

#include <bits/stdc++.h>

using namespace std;

double a,b,c,p,s;

int main()

{

cin>>a>>b>>c;

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

return 0;

}

#include <bits/stdc++.h>

using namespace std;

double a,b,c,h,p,s;

int main()

{

cin>>a>>b>>c;

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

if (s>50) cout<<"Dien tich tam giac lon hon";

else cout<<"Dien tich tam giac nho hon";

return 0;

}

11 tháng 10 2021

2: 

#include <bits/stdc++.h>

using namespace std;

int main()

{

string st;

int a;

cin>>st;

cin>>a;

cout<<"Xin chao "<<st<<endl;

cout<<"Nam nay "<<st<<" "<<2021-a<<" tuoi";

return 0;

}

11 tháng 4 2021

program timtich;

uses  crt;

var i,n:integer;

tich:longint;

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

begin

clrscr;

write('nhap so n:');readln(n);

for i:=1 to n do

begin

write('nhap phan tu a[',i,']:');readln(a[i]);

end;

for i:=1 to n do

write(a[i]:4);

tich:=1;

writeln;

for i:=1 to n do

if a[i] mod 2=0 then tich:=tich*a[i];

writeln('tich ca phan tu chan cua mang la:',tich);

readln;

end.

program timtong;

uses  crt;

var i,n:integer;

tong:longint;

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

begin

clrscr;

write('nhap so n:');readln(n);

for i:=1 to n do

begin

write('nhap phan tu a[',i,']:');readln(a[i]);

end;

for i:=1 to n do

write(a[i]:4);

tong:=0;

writeln;

for i:=1 to n do

if a[i] mod 2=0 then tong:=tong+a[i];

writeln('tong cac phan tu chan cua mang la:',tong);

tong:=0;

writeln;

for i:=1 to n do

if a[i] mod 2=1 then tong:=tong+a[i];

writeln('tong cac phan tu le cua mang la:',tong);

readln;

end.

Bài 1: 

uses crt;

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

i,n,s:integer;

begin

clrscr;

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

for i:=1 to n do 

begin

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

end;

s:=1;

for i:=1 to n do 

  if a[i] mod 2=0 then s:=s*a[i];

writeln(s);

readln;

end.

D
datcoder
CTVVIP
28 tháng 11 2023

C++

#include<bits/stdc++.h>

using namespace std;

int main() {

const double pi = 3.14159;

double a,b,c;

cin >> a >> b >> c;

double sinc= sin(c*(pi/180));

cout << fixed << setprecision(2) << (a*b*sinc)/2 << endl;

return 0;

}

27 tháng 11 2023

import math

def tinh_dien_tich_tam_giac(a, b, goc_xen):
    goc_rad = math.radians(goc_xen)
    
    dien_tich = 0.5 * a * b * math.sin(goc_rad)
    
    return dien_tich

a = float(input("Nhập độ dài cạnh a: "))
b = float(input("Nhập độ dài cạnh b: "))
goc_xen = float(input("Nhập góc xen giữa hai cạnh (đơn vị độ): "))

dien_tich_tam_giac = tinh_dien_tich_tam_giac(a, b, goc_xen)
print("Diện tích tam giác là:", dien_tich_tam_giac)