tinh tong cac so nguyen a sao cho:
-50<a<hoac bang 50
-100 nho hon hoac bang a va a nho hon 100
a,Tim cac so nguyen a,b sao cho a.b=-3
b,tinh tong cac so nguyen x biet: -6<x+2<8
c,tim tat ca cac U(-15)
bấm vào chữ 0 đúng sẽ hiện ra kết quả
Tim tap hop cac so nguyen x sao cho-6<x5 hay tinh tong cac so nguyen trong tap hop do
Tinh tong A + B biet rang A la tong cac so nguyen am le 2 chu so B la tong cac so nguyen duong chan co 2 chu so
CAU 1:
A, Nhap vao so nguyen n ; Tinh tong S= 1+2+3+...+n
B, Nhap vao mot mang gom m so nguyen . Tinh tong cac phan tu cua mang do.
GIUP MINH VOI NHA MOI NGUOI ...
A:
uses crt;
var t,i,n:integer;
begin
clrscr;
write('Nhap n='); readln(n);
t:=0;
for i:=1 to n do
t:=t+i;
writeln(t);
readln;
end.
B:
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('Nhap m='); readln(m);
for i:=1 to m do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
for i:=1 to m do
t:=t+a[i];
writeln(t);
readln;
end.
a, tim cac so nguyen n biet -3 nho hon hoac bang n va nho hon 5.
b, tinh tong cac so nguyen tim duoc o cau a.
a, - 3 \(\le\) n < 5
n \(\in\left\{-3;-2;-1;0;1;2;3;4\right\}\)
b, Tổng :
- 3 + ( - 2 ) + ( - 1 ) + 0 + 1 + 2 + 3 + 4
= [ ( - 3 ) + 3 ] + [ ( - 2 ) + 21 ] + [ ( - 1 ) + 1 ] + 0 + 4
= 0 + 0 + 0 + 0 + 4 = 4
thankiu ban nha!!
Viet chuong trinh nhap vao cac so nguyen a,b,c,d,e tinh tong cac so co chu so tan cung la 5 va 0
#include <bits/stdc++.h>
using namespace std;
long long a,b,c,d,e,t;
int main()
{
cin>>a>>b>>c>>d>>e;
t=0;
if ((a%10==0) or (a%10==5)) t=t+a;
if ((b%10==0) or (b%10==5)) t=t+b;
if ((c%10==0) or (c%10==5)) t=t+c;
if ((d%10==0) or (d%10==5)) t=t+d;
if ((e%10==0) or (e%10==5)) t=t+e;
cout<<t;
return 0;
}
tim 3 so nguyen to lien tiep sao cho tong cac binh phuong cua cac so so do la 1 so nguyen to
cau 1: viet ct nhap 10 so nguyen tu ban phim ,cho biet so lon nhat (nho nhat) trong cac so do
cau 2:viet ct nhap 20 so nguyen tu ban phim ,tinh tong cac le trong so do
Câu 1:
Program HOC24;
var a: array[1..10] of integer;
min,max,i: integer;
begin
for i:=1 to 10 do
begin
write('Nhap so thu ',i,' : '); readln(a[i]);
end;
min:=32000; max:=0;
for i:=1 to 10 do
begin
if max<a[i] then max:=a[i];
if min>a[i] then min:=a[i];
end;
writeln('So lon nhat la :',max);
write('So nho nhat la : ',min);
readln
end.
Câu 2:
Program HOC24;
var a: array[1..20] of integer;
t,i: integer;
begin
for i:=1 to 20 do
begin
write('Nhap so thu ',i,' : '); readln(a[i]);
end;
t:=0;
for i:=1 to 20 do
if a[i] mod 2<>0 then t:=t+a[i];
writeln('Tong cac so le la :',t);
readln
end.
bai1.Tinh tong cua cac so nguyen am tu -1738 den -16
bai2.Tinh tong sau bang 2 cach
A=1+(-2)+3+(-4)+....+99+(-100)
bai1 tu -1738 den -16 co so cac so nguyen am la : (1738-16)/2+1=862
C1
B=1+3+5+..+99=50.(99+1)/2=50.50=2500
C=-(2+4+6+...+100)=50.(100+2)/2=50*51=-2550
A=B+C=2500-2550=-50
C2
A=1+(3-2)+(5-4)+...+(99-98)+100
=1+1+1+...+1-100
=1+49-100=-50