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.
uses crt;
var m,n,t,i:integer;
begin
clrscr;
write('Nhap m='); readln(m);
write('Nhap n='); readln(n);
t:=0;
for i:=m to n do
t:=t+i;
writeln(t);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,A[100],dem,t;
cin>>n;
for (int i=1; i<=n; i++)
cin>>A[i];
dem=0; t=0;
for (int i=1; i<=n; i++)
if (A[i]%2==0) dem++;
else t+=A[i];
cout<<dem<<endl;
cout<<t;
return 0;
}
uses crt;
var i,n:integer;
begin
write('nhap n=');readln(n);
writeln('bang nhan',n);
for i:=1 to 10 do writeln(n,' x ',i:2,' = ',n*i:3);
readln
end.
Program HOC24;
var n,d,i: integer;
B: array[1..100] of integer;
t: longint;
begin
write('Nhap N: '); readln(n);
for i:=1 to n do
begin
write('B[',i,']='); readln(b[i]);
end;
d:=0; t:=0;
for i:=1 to n do
if b[i]>0 then
begin
d:=d+1;
t:=t+b[i];
end;
writeln('Tong cac so duong trong day so la: ',t);
write('Co ',d,' so duong trong day');
readln
end.
uses crt;
var b:array[1..100] of longint;
n,i,d,s:longint;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('a[',i,']: '); readln(b[i]);
if b[i]>0 then begin
inc(d);
inc(s,b[i]);
end;
end;
writeln('Tong cac so duong: ',s);
writeln('Co ',d,' so duong');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long i,n,s;
int main()
{
cin>>n;
s=1;
for (i=1; i<=n; i++) if (i%2==0) s*=i;
cout<<s;
return 0;
}
program TongSoChanTrongDay;
var
n, i, tong: integer;
a: array[1..100] of integer;
begin
tong := 0;
write('Nhap so phan tu cua day: ');
readln(n);
for i := 1 to n do
begin
write('Nhap phan tu thu ', i, ': ');
readln(a[i]);
if a[i] mod 2 = 0 then
tong := tong + a[i];
end;
writeln('Tong cac phan tu chan trong day la: ', tong);
readln;
end.
Bài 1:
uses crt;
var a:array[1..100]of integer;
i,n,min:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
min:=a[1];
for i:=1 to n do
if min>a[i] then min:=a[i];
writeln(min);
readln;
end.
Bài 2:
uses crt;
var a:array[1..100]of integer;
i,n,max:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
max:=a[1];
for i:=1 to n do
if max<a[i] then max:=a[i];
writeln(max);
readln;
end.