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.
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 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 bt_3;
Uses crt;
Var Tong, n, i: integer;
Begin
Clrscr;
Writeln(‘nhap n=’);
Readln (n);
Tong:=0;
For i:=1 to n do
If I mod 3 = 0 then Tong:=Tong+i;
Writeln(‘Tong la:’,Tong);
Readln
End.
Program bt_3;
Uses crt;
Var Tong, n, i: integer;
Begin
Clrscr;
Writeln(‘nhap n=’);
Readln (n);
Tong:=0;
For i:=1 to n do
If I mod 5 = 0 then Tong:= Tong+i;
Writeln(‘Tong la:’,Tong);
Readln
End.
#include <bits/stdc++.h>
using namespace std;
long long a,b,i,dem,s;
int main()
{
cin>>a>>b;
dem=0;
s=0;
for (i=a; i<=b; i++)
if (i%2==0)
{
dem++;
s=s+i;
}
cout<<dem<<" "<<s;
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a,b,i,dem,s;
int main()
{
cin>>a>>b;
dem=0;
s=0;
for (i=a; i<=b; i++)
if (i%2==0)
{
dem++;
s=s+i;
}
cout<<dem<<" "<<s;
return 0;
}
uses crt;
const fi='baitap.inp';
var f1:text;
a,b,i,t:integer;
begin
clrscr;
assign(f1,fi); reset(f1);
readln(f1,a,b);
t:=0;
for i:=a to b do
if i mod 2=0 then t:=t+i;
writeln(t);
close(f1);
readln;
end.
Bài 2:
uses crt;
var x,i,n,dem:integer;
begin
clrscr;
readln(n);
dem:=0;
for i:=1 to n do
begin
readln(x);
if x mod 2=0 then inc(dem);
end;
writeln(dem);
readln;
end.
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.