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.
Câu 1:
uses crt;
var i,t:integer;
begin
clrscr;
t:=0;
for i:=1 to 20 do
if i mod 4=0 then t:=t+i;
writeln(t);
readln;
end.
Câu 2:
uses crt;
var i,dem:integer;
begin
clrscr;
dem:=0;
for i:=1 to 20 do
if i mod 3=0 then dem:=dem+1;
writeln(dem);
readln;
end.
Câu 1:
#include <bits/stdc++.h>
using namespace std;
int t,i;
int main()
{
t=0;
for (i=1; i<=20; i++)
if (i%4==0) t=t+i;
cout<<t;
return 0;
}
2:
#include <bits/stdc++.h>
using namespace std;
int i,dem;
int main()
{
dem=0;
for (i=1; i<=20; i++)
if ((i%2==1) and (i%3==0)) dem++;
cout<<dem;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long i,m,t;
int main()
{
cin>>m;
t=0;
for (i=1; i<=m; i++)
if ((i%2!=0) and (i%7==0)) t=t+i;
cout<<t;
return 0;
}
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.
#include <bits/stdc++.h>
using namespace std;
long long m,n,i,t;
int main()
{
cin>>m>>n;
t=0;
for (i=m; i<=n; i++)
if (i%2==1) t=t+i;
cout<<t;
return 0;
}
Câu 1:
program an_danh;
uses crt;
var n,i:integer;
begin
clrscr;
n:= 0;
for i:= 1 to 100 do
if i mod 3 = 0 then n:= n + 1;
write('So cac so la boi cua 3 la: ',n);
readln
end.
Câu 2:
program an_danh;
uses crt;
var n,i:integer;
begin
clrscr;
n:= 0;
for i:= -100 to 100 do
if i mod 2 = 0 then n:= n + 1;
write('Cac so chan pham vi tu -100 den 100 la: ',n);
readln
end.
Câu 3:
program an_danh;
uses crt;
var i:integer;
begin
clrscr;
for i:= 1 to 100 do
if i mod 5 = 0 then write(i,' ');
readln
end.
Bài 1:
uses crt;
var i,dem:integer;
begin
clrscr;
dem:=0;
for i:=1 to 100 do
if i mod 3=0 then inc(dem);
writeln('so boi cua 3 trong pham vi tu 1 den 100 la: ',dem);
readln;
end.
Bài 2:
uses crt;
var i,dem:integer;
begin
clrscr;
dem:=0;
for i:=-100 to 100 do
if i mod 2=0 then inc(dem);
writeln('so luong so chan trong pham vi tu -100 den 100 la: ',dem);
readln;
end.
Bài 3:
uses crt;
var i,dem:integer;
begin
clrscr;
dem:=0;
for i:=1 to 100 do
if i mod 5=0 then inc(dem);
writeln('so boi cua 5 trong pham vi tu 1 den 100 la: ',dem);
readln;
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.
Đáp án đúng : B