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.
program baitap;
uses crt;
var thanhtien:real;
begin
clrscr;
write (' So tien khach da mua la: '); readln (thanhtien);
if thanhtien>=100000 then thanhtien := (70*thanhtien/100)
else thanh tien := (90*thanhtien/100);
writeln (' So tien khach phai tra la: ',thanhtien:4:2);
readln;
end.
var a,Thunhap_TB:real;i:Integer;
begin
thunhap_tb:=0;
for i:=1 to 50 do
begin
write('thu nhap cua gia dinh thu ',i);
readln(a);
thunhap_tb:= thunhap_tb + a
end;
thunhap_tb:= thunhap_tb/50;
for i := 1 to 50 do begin
write('thu nhap cua gia dinh thu',i) ; readln(a);
write('Do lech o voi thu nhap tb la : ', a - thunhap_tb)
end;
end.
Bạn kham khảo bài của mình nhé!
Program nhap_so_n;
Uses crt;
Var i,n,s:integer;
Begin clrscr;
Write('Nhap so n= ');Readln(n);
S:=0;
For i:=1 to n do
If i mod 2 = 0 do S:=S+i;
Writeln;
Write('tong cac so chan la ',S);
Readln;
End.
Mình chúc bạn học tốt!
program DiemKiemTra;
var
i, max: integer;
diem: array[1..30] of integer;
begin
for i := 1 to 30 do
begin
writeln('Nhap diem cua hs thu ', i, ': ');
readln(diem[i]);
end;
max := diem[1];
for i := 2 to 30 do
begin
if diem[i] > max then
max := diem[i];
end;
writeln('Diem cao nhat la: ', max);
end.
program Tinh_tien;
uses crt
var a,b:integer;
T:real;
begin
clrscr;
writeln('Nhap don gia:',a);readln(a);
writeln('Nhap so luong:',b);readln(b);
T:=a*b;
if T>=100000 then T:=T*0.7 else T:=T*0.9
writeln('So tien phai tra:',T);
readln
end.
program Tinh_tien;
uses crt
var a,b:integer;
T:real;
begin
clrscr;
writeln('Nhap don gia:',a);readln(a);
writeln('Nhap so luong:',b);readln(b);
T:=a*b;
if T>=100000 then T:=T*0.7 else T:=T*0.9
writeln('So tien phai tra:',T);
readln
end.
#include <bits/stdc++.h>
using namespace std;
double a[100],t;
int n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
for (i=1; i<=n; i++)
cout<<"Diem cua ban thu "<<i<<" la: "<<fixed<<setprecision(2)<<a[i]<<endl;
t=0;
for (i=1; i<=n; i++) t+=a[i];
cout<<"Trung binh cua lop la: "<<fixed<<setprecision(2)<<t/(n*1.0);
return 0;
}
Tham khảo:
program gia_tri_tuong_ung;
uses crt;
var x,y,z:integer;
begin
clrscr;
write("Nhap x=");readln(x);
write("Nhap y=");readln(y);
writeln('Hai so nguyen truoc khi hoan doi');
writeln('a=',a);
writeln('b=',b);
z:=x;
x:=y;
y:=z;
writeln('Hai so nguyen sau khi hoan doi');
writeln('a=',a);
writeln('b=',b);
readln;
end.