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.

const fi='vb.txt';

fo='kq.txt';

var f1,f2:text;

a,b,c,t,s:real;

begin

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

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

readln(f1,a,b,c);

t:=a+b+c;

s:=a*b*c;

writeln(f2,'tong la: ',t:4:2);

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

close(f1);

close(f2);

end.

10 tháng 2 2020

Program hotrotinhoc;

const fi='vb.txt';

fo='kq.txt';

var f: text;

a,b,c: real;

procedure ip;

begin

assign(f,fi);

reset(f);

read(f,a,b,c);

close(f);

end;

procedure out;

begin

assign(f,fo);

rewrite(f);

writeln(f,'Tong : ',a+b+c:1:2);

write(f,'Tich : ',a*b*c:1:2);

close(f);

end;

begin

ip;

out;

end.

const fi='input.txt';

fo='output.txt';

var f1,f2:text;

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

i,n,t:integer;

begin

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

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

n:=0;

while not eof(f1) do 

begin

inc(n);

read(f1,a[n]);

end;

t:=0;

for i:=1 to n do t:=t+a[i];

write(f2,t);

close(f1);

close(f2);

end.

24 tháng 4 2020

Program hotrotinhoc_hoc24;

const fi='BT.TXT';

fo='KQ.TXT';

var f: text;

x,y,z: integer;

t: longint;

procedure ip;

begin

assign(f,fi);

reset(f);

read(f,x,y,z);

close(f);

end;

procedure out;

begin

assign(f,fo);

rewrite(f);

t:=x+y+z;

write(f,t);

close(f);

end;

begin

ip;

out;

end.

uses crt;

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

i,n,max,min:integer;

begin

clrscr;

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

for i:=1 to n do

  begin

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

end;

max:=a[1];

min:=a[1];

for i:=1 to n do 

  begin

if max<a[i] then max:=a[i];

if min>a[i] then min:=a[i];

end;

writeln('So lon nhat la: ',max);

writeln('So nho nhat la: ',min);

readln;

end.

1 tháng 5 2021

E cảm ơn

#include <bits/stdc++.h>

using namespace std;

long long n,i,t;

int main()

{

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

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

cin>>n;

t=0;

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

if (i%2==0) t+=i;

cout<<t;

return 0;

}

const fi='bt.txt';

fo='kt.txt';

var f1,f2:text;

a,b,c,tbc:real;

begin

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

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

readln(f1,a,b,c);

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

writeln(f2,tbc:4:2);

close(f1);

close(f2);

end.

uses crt;

const fi='so.txt';

var f1:text;

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

n,i:integer;

begin

clrscr;

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

readln(f1,n);

for i:=1 to n do  

  read(f1,a[i]);

for i:=1 to n do 

  write(a[i]:4);

close(f1);

readln;

end.

Uses crt;

Const fi='dl.int';

Var f1:text;

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

I,n,t: integer;

Begin

Clrscr;

Assign(f1,fi); reset(f1);

Readln(f1,n);

For i:=1 to n do

Read(f1,a[i]);

T:=0;

For i:=1 to n do

T:=t+a[i];

Writeln(t);

Close(f1);

Readln;

End.