Bạn chưa đăng nhập. Vui lòng đăng nhập để hỏi bài

Những câu hỏi liên quan
Khoi Tran
Xem chi tiết
Nguyễn Lê Phước Thịnh
20 tháng 4 2021 lúc 20:53

Câu 1: 

uses crt;

const fi='nguon.txt'

var f1:text;

a,b,c:integer;

begin

clrscr;

write('a='); readln(a);

write('b='); readln(b);

write('c='); readln(c);

assign(f1,fi); rewrite(f1);

writeln(f1,a);

writeln(f1,b);

writeln(f1,c);

close(f1);

readln;

end.

Nguyễn Lê Phước Thịnh
20 tháng 4 2021 lúc 20:56

Câu 2: 

const fi='nguon.txt'

fo='kq.txt'

var f1,f2:text;

a,b,c,max,min:integer;

begin

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

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

readln(f1,a);

readln(f1,b);

readln(f1,c);

writeln(f2,(a+b+c)/3:4:2);

max:=a;

if max<b then max:=b;

if max<c then max:=c;

writeln(f2,max);

min:=a;

if min>b then min:=b;

if min>c then min:=c;

writeln(f2,min);

close(f1);

close(f2);

end.

Exo Aeri
Xem chi tiết
Nguyễn Lê Phước Thịnh
26 tháng 1 2022 lúc 13:12

#include <bits/stdc++.h>

using namespace std;

long long a[10],b[10],i,j;

int main()

{

freopen("input.txt","r",stdin);

freopen("output.txt","w",stdout);

for (i=1; i<=10; i++) cin>>a[i];

for (j=1; j<=10; j++) cin>>b[j];

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

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

return 0;

}

No One Actually
Xem chi tiết
No One Actually
11 tháng 4 2021 lúc 20:11

help

 

Nguyễn Lê Phước Thịnh
12 tháng 4 2021 lúc 13:04

const fi='input.txt'

fo='output.txt'

var f1,f2:text;

a,b,c,max:real;

begin

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

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

readln(f1,a,b,c);

min:=a;

if min>b then min:=b;

if min>c then min:=c;

writeln(f2,min);

close(f1);

close(f2);

end.

Trần Quốc Luân
Xem chi tiết
TÌNH ĐIÊN DẠI
Xem chi tiết
hoichut
Xem chi tiết
Dania sunna
Xem chi tiết
Nguyễn Lê Phước Thịnh
19 tháng 12 2021 lúc 23:23

#include <bits/stdc++.h>

using namespace std;

long long a,b,c,d;

int main()

{

freopen("input.txt","r",stdin);

freopen("output.txt","w",stdout);

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

cout<<a+b+c+d;

return 0;

}

Cam Giang
Xem chi tiết
Nguyễn Lê Phước Thịnh
29 tháng 10 2019 lúc 17:54

uses crt;
const fi='input.txt';
fo='output.txt';
var f1,f2:text;
a:array[1..100]of integer;
dem,i,t:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
dem:=0;
while not eoln(f1) do
begin
inc(dem);
read(f1,a[dem]);
end;
writeln(f2,'so luong so nguyen co trong day la: ',dem);
{---------------tinh-tong------------------}
t:=0;
for i:=1 to dem do
t:=t+a[i];
writeln(f2,'tong gia tri cac so nguyen trong day la: ',t);
close(f1);
close(f2);
readln;
end.

Khách vãng lai đã xóa
Tuoi tom May
Xem chi tiết
Phía sau một cô gái
4 tháng 5 2023 lúc 20:40

program TimMinMaxTrungBinh;

var

      N, i, max, min, sum: integer;

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

      TB, minTB, maxTB: real;

begin

      writeln('Nhap so nguyen duong N:');

      readln(N);

      sum := 0;

      for i := 1 to N do

      begin

            write('Nhap so thu ', i, ': ');

            readln(a[i]);

            sum := sum + a[i];

      end;

      max := a[1];

      min := a[1];

      for i := 2 to N do

      begin

            if a[i] > max then

                  max := a[i];

            if a[i] < min then

                  min := a[i];

      end;

      TB := sum / N;

      minTB := TB;

      maxTB := TB;

      for i := 1 to N do

      begin

            if (a[i] < TB) and (a[i] < minTB) then

                  minTB := a[i];

            if (a[i] > TB) and (a[i] > maxTB) then

                  maxTB := a[i];

      end;

      writeln('Gia tri lon nhat la: ', max);

      writeln('Gia tri nho nhat la: ', min);

      writeln('Gia tri trung binh la: ', TB:2:2);

      if minTB = TB then

            writeln('Khong co gia tri nao nho hon TB')

      else

            writeln('Gia tri nho nhat < TB la: ', minTB);

      if maxTB = TB then

            writeln('Khong co gia tri nao lon hon TB')

      else

            writeln('Gia tri lon nhat > TB la: ', maxTB);

      readln;

end.