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='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.
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 = 0 then Tong:= Tong+i;
write(f2, Tong);
close(f1);
close(f2);
End.
#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;
}
2:
#include <bits/stdc++.h>
using namespace std;
long long n,i;
int main()
{
cin>>n;
for (i=1; i<=n; i++)
if (n%i==0) cout<<i<<" ";
return 0;
}
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.
Program HOC24;
var m,n,i: integer;
t1,t2: longint;
begin
write('Nhap m;n: '); readln(m,n);
t1:=1; t2:=1;
for i:=1 to n do t1:=t1*i;
for i:=m to n do t2:=t2*i;
writeln('T1=',t1);
write('T2=',t2);
readln
end.
Mk có mở đc đâu
Là sao đề sai è