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.
#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;
}
Var f1, f2: text;
Tong, m, n, i: integer;
Begin
assign(f1, ‘DULIEU.TXT’);
reset(f1);
assign(f2, ‘KETQUA’);
rewrite(f2);
Tong;= 0;
read(f1, m, n);
for i:= m to n do
if i mod 2 = 0 then Tong:= Tong+i;
write(f2, Tong);
close(f1);
close(f2);
End.
const fi='dulieu.txt';
fo='ketqua.txt';
var f1,f2:text;
m,n,i,t:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,m,n);
t:=0;
for i:=m to n do
if i mod 2=0 then t:=t+i;
writeln(f2,t);
close(f1);
close(f2);
end.
Var f1, f2: text;
Tong, m, n, i: integer;
Begin
assign(f1, ‘DULIEU.TXT’);
reset(f1);
assign(f2, ‘KETQUA’);
rewrite(f2);
Tong;= 0;
read(f1, m, n);
for i:= m to n do
if i mod 2 = 0 then Tong:= Tong+i;
write(f2, Tong);
close(f1);
close(f2);
End.
Var f1, f2: text;
Tong, m, n, i: integer;
Begin
assign(f1, ‘DULIEU.TXT’);
reset(f1);
assign(f2, ‘KETQUA’);
rewrite(f2);
Tong;= 0;
read(f1, m, n);
for i:= m to n do
if i mod 2 = 1 then Tong:= Tong+i;
write(f2, Tong);
close(f1);
close(f2);
End.
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.
Program hotrotinhoc_hoc24;
const fi='C:\Input.txt';
fo='C:\Output.txt';
var f: text;
i,n: integer;
procedure ip;
begin
assign(f,fi);
reset(f);
read(f,n);
close(f);
end;
procedure out;
begin
assign(f,fo);
rewrite(f);
for i:=1 to n do write(f,i,' ');
close(f);
end;
begin
ip;
out;
end.
const fi='input.txt';
fo='output.txt';
var f1,f2:text;
i,n:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n);
for i:=1 to n do
write(f2,i:4);
close(f1);
close(f2);
end.
const fi='input.txt';
fo='output.txt';
var f1,f2:text;
n,i,dem:integer;
a:array[1..100]of integer;
{------------------------chuong-trinh-con-1----------------------------}
procedure docfile;
begin
assign(f1,fi); reset(f1);
readln(f1,n);
for i:=1 to n do
read(f1,a[i]);
close(f1);
end;
{------------------------chuong-trinh-con-2----------------------------}
procedure xuatfile;
begin
assign(f2,fo); rewrite(f2);
dem:=0;
for i:=1 to n do
if a[i] mod 5=0 then inc(dem);
writeln(f2,dem);
close(f2);
end;
{-------------------------chuong-trinh-chinh-------------------------}
begin
docfile;
xuatfile;
end.
const fi='dulieu.txt';
fo='ketqua.txt';
var f1,f2:text;
a,b,c,d:array[1..100]of integer;
i,n,dem,dem1: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],b[n]);
end;
dem:=0;
dem1:=0;
for i:=1 to n do
if a[i]>b[i] then
begin
inc(dem);
inc(dem1);
c[dem]:=a[i];
d[dem]:=b[i];
end
else begin
inc(dem);
inc(dem1);
c[dem]:=b[i];
d[dem]:=a[i];
end;
for i:=1 to dem do
write(f2,c[i]:4);
writeln(f2);
for i:=1 to dem1 do
write(f2,d[i]:4);
close(f1);
close(f2);
end.
Bài 1:
const fi='input.txt';
fo='output.txt';
var f1,f2:text;
a,b,s:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,a,b);
s:=a*b;
writeln(f2,s);
close(f1);
close(f2);
end.
Bài 2:
const fi='dulieu.txt';
fo='ketqua.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>b then writeln(f2,a)
else if b>a then writeln(f2,b)
else writeln(f2,' khong co so lon nhat trong hai so');
close(f1);
close(f2);
end.