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.

3 tháng 2 2021

program Trung_Binh_Cong;

uses crt;

var t1,t2,t3,t4,tong: real;

begin

clrscr;

write('nhap so thu nhat =');

readln(t1);

write('nhap so thu hai =');

readln(t2);

write('nhap so thu ba =');

readln(t3);

write('nhap so thu tu =');

readln(t4);

tong:=t1+t2+t3+t4;

write('Trung binh cong cua 4 so = ' ,tong div 4);

readln;

end.

3 tháng 2 2021

Program TB_Cong_4_So;

uses crt;

Var a, b, c, d: real;

Begin

Clrscr;     

Write('Nhap so thu nhat:');readln(a);     

Write('Nhap so thu hai:');readln(b);     

Write('Nhap so thu ba:');readln(c);     

Write('Nhap so thu tu:');readln(d);     

Writeln('Trung binh cong: ',(a+b+c+d)/4);     

Readln;

End.

21 tháng 11 2021

-khai báo :

#include<iostream>

using namespace std;

(hoặc bạn có thể khai báo kiểu khác vd :

#include<iostream>

using namespace std;

void show() { ...... }

)

-Tạo 3 biến có thể nhập từ bàn phím a, b, c bằng cách :

int a, b, c;

cin >> a >> b >> c;

-Tạo biến bất kì lưu giá trị của tổng ba số a, b, c bằng cách :

int h = a + b + c;

-xuất ra màn hình giá trị của h / 3 bằng cách :

cout << "(a + b + c) / 3 = " << h / 3;

-kết thúc chương trình :

return 0; 

}

(hoặc tùy bạn)

2 tháng 11 2021

uses crt;

var

a,b,c,s:integer;

begin

readln(a,b,c);

s:=(a+b+c)/3;

writeln('TBC 3 so a,b,c la: ',s);

readln

end.

#include <bits/stdc++.h>

using namespace std;

double a,b,c,d,tb;

int main()

{

cin>>a>>b>>c>>d;

if (a>0 && b>0 && c>0 && d>0) cout<<fixed<<setprecision(2)<<(a+b+c+d)/4;

else cout<<"Day khong phai bon so cung duong";

return 0;

}

 

19 tháng 12 2021

 

 

#include <bits/stdc++.h>
using namespace std;
long long n;
//chuongtrinhcon
bool ktnt(long long n)
{
    if (n<2) return(false);
    else
    for (int i=2; i*i<=n;i++)
        if (n%i==0) return (false);
    return(true);

}
//chuongtrinhchinh
int main()
{
    //freopen("KTSNT.INP","r",stdin);
    //freopen("KTSNT.OUT","w",stdout);
    cin>>n;
    if (ktnt(n)==true) cout<<"1";
    else cout<<"0";
    return 0;
}

20 tháng 4 2022

Var a:array[1..20] of integer;

max,min:integer;

tbc:real;

Begin

For i:=1 to 20 do

Begin

Write('Nhap so thu ',i,' = ');readln(a[i]);

End;

Max:=a[1];

Min:=a[1];

For i:=2 to 20 do

Begin

If a[i] > max then max:=a[i];

If a[i] < min then min:=a[i];

End;

tbc:=(max+min)/2;

Writeln('So lon nhat la ',max);

Writeln('So nho nhat la ',min);

Write('Trung binh cong la ',tbc:10:2);

Readln;

End.

c: 

#include <bits/stdc++.h>

using namespace std;

long long ln,i,n,x;

int main()

{

cin>>n;

ln=LLONG_MIN;

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

{

cin>>x;

ln=max(ln,x);

}

cout<<ln;

return 0;

}

20 tháng 4 2023

N=int(input(‘n=’))

A=[0]*n

For I in range(0,n):

A=int(input(a[‘+str(i+1)+’]=’))

S=s+a[i]

S1 =s/n

Print(s1)

20 tháng 4 2022

Var a:array[1..20] of integer;

max,min:integer;

tbc:real;

Begin

For i:=1 to 20 do

Begin

Write('Nhap so thu ',i,' = ');readln(a[i]);

End;

Max:=a[1];

Min:=a[1];

For i:=2 to 20 do

Begin

If a[i] > max then max:=a[i];

If a[i] < min then min:=a[i];

End;

tbc:=(max+min)/2;

Writeln('So lon nhat la ',max);

Writeln('So nho nhat la ',min);

Write('Trung binh cong la ',tbc:10:2);

Readln;

End.