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='data.txt';
fo='ketqua.txt';
var f1,f2:text;
a,b,h:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b,h);
writeln(f2,0.5*h*(a+b):4:2);
close(f1);
close(f2);
end.
Uses crt;
var f1,f2:text;
i,n,tong,tongchan,dem:integer;
tb:real;
Begin
clrscr;
Assign(f1,'DAYSO.txt');
Assign(f2,'KETQUA.txt');
reset(f1);dem:=0;tong:=0;tongchan:=0;
While Not EOF(f1) do
Begin
read(f1,i);
inc(tong,i);
If i mod 2 = 0 then
begin
inc(dem);
inc(tongchan,i);
end;
End;
tb:=tongchan/dem;
close(f1);
rewrite(f2);
writeln(f2,tong);
writeln(f2,tongchan);
writeln(f2,tb:0:2);
close(f2);
write(tong);
readln;
End.
#include <bits/stdc++.h>
using namespace std;
long long x,y;
int main()
{
cin>>x>>y;
freopen("kq.txt","w",stdout);
cout<<x+y<<endl;
cout<<x-y<<endl;
cout<<x*y<<endl;
cout<<fixed<<setprecision(2)<<(x*1.0)/(y*1.0);
return 0;
}
uses crt;
const fi='canh_ht.int';
var f1:text;
a,b,h,c,d:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,a,b,c,d,h);
writeln(a+b+c+d);
writeln(1/2*h*(a+b):4:2);
close(f1);
readln;
end.
const fi='data1.txt';
fo='data2.txt';
var f1,f2:text;
a,b:real;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b);
writeln(f2,(a+b)/2:4:2);
close(f1);
close(f2);
end.