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.
![](https://rs.olm.vn/images/avt/0.png?1311)
const fi='input.txt';
fo='soan.txt';
var f1,f2:text;
a:array[1..100]of integer;
i,n:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
n:=0;
while not eof(f1) do
begin
n:=n+1;
readln(f1,a[n]);
end;
for i:=1 to n do
if a[i]<0 then writeln(f2,a[i]:4);
close(f1);
close(f2);
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
const fi='so.inp';
var f1:text;
a,b:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
while not eof(f1) do
begin
readln(f1,a,b);
writeln((a+b)/2:4:2);
end;
close(f1);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
const fi='dulieuvao.dat';
var f1:text;
a,b,c,d,e:array[1.1.00]of integer;
n,m,d,x,v,t,t1,t2,t3,t4,t5,i:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
n:=0;
while not eoln(f1) do
begin
n:=n+1;
read(f1,a[n]);
end;
readln(f1);
m:=0;
while not eoln(f1) do
begin
inc(m);
read(f1,b[m]);
end;
readln(f1);
d:=0;
while not eoln(f1) do
begin
inc(d);
read(f1,c[d]);
end;
readln(f1);
x:=0;
while not eoln(f1) do
begin
inc(x);
read(f1,d[x]);
end;
readln(f1);
v:=0;
while not eoln(f1) do
begin
inc(v);
read(f1,e[v]);
end;
t:=0;
for i:=1 to n do
t:=t+a[i];
writeln('Tong cua day 1 la: ',t);
t1:=0;
for i:=1 to m do
t1:=1+b[i];
writeln('Tong cua day 2 la: ',t1);
t2:=0;
for i:=1 to d do
t2:=t2+c[i];
writeln('Tong cua day 3 la: ',t2);
t3:=0;
for i:=1 to x do
t3:=t3+d[i];
writeln('Tong cua day 4 la: ',t3);
t4:=0;
for i:=1 to v do
t4:=t4+e[i];
writeln('Tong cua day 5 la: ',t4);
close(f1);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
const fi='tamgiac.dat';
var f1:text;
a,b,c:array[1..100]of real;
n,i,j,k,dem:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
n:=0;
while not eof(f1) do
begin
inc(n);
readln(f1,a[n],b[n],c[n]);
end;
dem:=0;
for i:=1 to n do
for j:=1 to n do
for k:=1 to n do
if (i=j) and (j=k) then
begin
if (a[i]+b[j]>c[k]) and (a[i]+c[k]>b[j]) and (c[k]+b[j]>a[i]) then
begin
if (a[i]=b[j]) and (a[i]<>c[k]) and (b[j]<>c[k]) then inc(dem);
if (a[i]=c[k]) and (a[i]<>b[j]) and (c[k]<>b[j]) then inc(dem);
if (b[j]=c[k]) and (b[j]<>a[i]) and (c[k]<>a[i]) then inc(dem);
end;
end;
writeln(dem);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
#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;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
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.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
const fi='input.txt';
fo='output.txt';
var f1,f2:text;
a,b:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b);
if (a=0) and (b=0) then writeln(f2,'Phuong trinh co vo so nghiem');
if (a<>0) then writeln(f2,-b/a:4:2);
if (a=0) and (b<>0) then writeln(f2,'Phuong trinh vo nghiem');
close(f1);
close(f2);
end.
uses crt;
const fi='input.txt';
var f1:text;
a,b,c:array[1..100]of real;
i,n:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
n:=0;
while not eof(f1) do
begin
n:=n+1;
readln(f1,a[n],b[n],c[n]);
end;
for i:=1 to n do
writeln('Tong cua dong ',i,' la: ',a[i]+b[i]+c[i]:4:2);
for i:=1 to n do
writeln('Trung binh cong cua dong ',i,' la: ',(a[i]+b[i]+c[i])/3:4:2);
close(f1);
readln;
end.