rút gọn
A=2 + 2 mũ 2 + 2 mũ 3 + .....+ 2 mũ 2023
B=3 mũ o + 3 mũ 1 + 3 mũ 2 + ..... + 3 mũ 100
C= 4 mũ 0 + 4 mũ 2 + 2 mũ 4 + .............+ 4 mũ 100
D=1 + 5 mũ 2 + 5 mũ 4 + 5 mũ 6 + ............... + 5 mũ 2022
S=a mũ 0 + a mũ 1 + a mũ 2 + ..........+a mũ n
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.
#include <bits/stdc++.h>
using namespace std;
long long x,i,n,nn;
int main()
{
cin>>n;
int dem=0;
for (i=1; i<=n; i++)
{
cin>>x;
if (x==0) dem++;
}
cout<<dem;
return 0;
}
a:
#include <bits/stdc++.h>
using namespace std;
long long n,x,i,t;
int main()
{
cin>>n;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
t=t+x;
}
cout<<t;
return 0;
}
Uses crt;
var i,n,k,u,f,y: longint;
a: array[1..100] of longint;
begin clrscr;
readln(n);
for i:=1 to n do read(a[i]); readln;
writeln(a[i]);
for i:=1 to n do if(a[i]<0) then k:=k+a[i];
for i:=1 to n do if(a[i]>0) then u:=u+a[i];
for i:=1 to n do if(a[i] mod 2<>0) then f:=f+a[i];
for i:=1 to n do if(a[i] mod 2=0) then y:=y+a[i];
writeln('Tong cac so am la: ',k);
writeln('Tong cac so khong am: ',u);
writeln('Tong cac so le la: ',f);
writeln('Tong cac so chan la: ',y);
readln;
end.
a:
#include <bits/stdc++.h>
using namespace std;
long long x,i,n,t;
int main()
{
cin>>n;
t=0;
for (i=1; i<=n; i++)
{
cin>>x;
t=t+x;
}
cout<<t;
return 0;
}
uses crt;
var a: array [1..100] of integer;
n, i, tsc, tsl: integer
begin
clrscr;
write('So phan tu cua mang la: '); readln(n);
while n<1 do begin
write('So phan tu chi tu 2 tro len, ban da nhap sai, nhap lai: '); readln(n);
end;
for i:=1 to n do begin
write('So thu ',i,' la: '); readln(a[i]);
end;
tsc:=0;
tsl:=0;
for i:=1 to n do
if a[i] mod 2 =0 then tsc:=tsc+a[i]
else tsl:=tsl+a[i];
writeln('tong cac so chan la: ',tsc);
write('tong so cac so le la: ',tsl);
readln;
end.
Program bai1;
uses crt;
var i,n,s,s1: integer;
a:array[1..100] of integer;
begin
clrscr;
write('nhap n =');readln(n);
for i:=1 to n do
begin
write('nhap a[',i,'] ='); readln(a[i]);
end;
for i:= 1 to n do
if a[i] mod 2 = 0 then s:=s+a[i];
writeln('tong cac so duong = ' ,s);
for i:= 1 to n do
if a[i] mod 2 <> 0 then s1:=s1+a[i];
writeln('tong cac so le =' ,s1);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,dem,dem1,dem2,t:integer;
s:real;
begin
clrscr;
write('Nhap n='); readln(n);
for i:=1 to n do
begin
repeat
write('A[',i,']='); readln(a[i]);
until a[i]>0;
end;
for i:=1 to n do
write(a[i]:4);
writeln;
dem:=0;
for i:=1 to n do
if a[i]>10 then inc(dem);
writeln('So phan tu lon hon 10 la: ',dem);
dem1:=0;
dem2:=0;
for i:=1 to n do
begin
if a[i] mod 2=0 then inc(dem1)
else inc(dem2);
end;
writeln('So luong so chan la: ',dem1);
writeln('So luong so le la: ',dem2);
t:=0;
s:=1;
for i:=1 to n do
begin
if (i mod 2=0) and (a[i] mod 2<>1) then t:=t+a[i];
if (i mod 2=1) and (a[i] mod 2=0) then s:=s*a[i];
end;
writeln('Tong cac so o vi tri chan co gia tri le la: ',t);
writeln('Tich cac so o vi tri le co gia tri chan la: ',s:4:2);
writeln('Cac so le la: ');
for i:=1 to n do
if a[i] mod 2<>0 then write(a[i]:4);
writeln;
writeln('Cac so chan va lon hon 10 la: ');
for i:=1 to n do
if (a[i] mod 2=0) and (a[i]>10) then write(a[i]:4);
readln;
end.
\(A=2+2^2+2^3+...+2^{2023}\)
\(2A=2^2+2^3+2^4+...+2^{2024}\)
\(2A-A=\left(2^2+2^3+2^4+...+2^{2024}\right)-\left(2+2^2+2^3+...+2^{2023}\right)\)
\(A=2^{2024}-2\)
\(B=3^0+3^1+3^2+...+3^{100}\)
\(3B=3^1+3^2+3^3+...+3^{101}\)
\(3B-B=\left(3^1+3^2+3^3+...+3^{101}\right)-\left(3^0+3^1+3^2+...+3^{100}\right)\)
\(2B=3^{101}-3\)
\(B=\dfrac{3^{101}-3}{2}\)
\(C=4^0+4^2+...+4^{100}\)
=>\(16C=4^2+4^4+...+4^{102}\)
=>\(16C-C=4^2+4^4+...+4^{102}-4^0-4^2-...-4^{100}\)
=>\(15C=4^{102}-1\)
=>\(C=\dfrac{4^{102}-1}{15}\)
\(D=1+5^2+5^4+...+5^{2022}\)
=>\(25D=5^2+5^4+...+5^{2024}\)
=>\(25D-D=5^2+5^4+...+5^{2024}-1-5^2-...-5^{2022}\)
=>\(24D=5^{2024}-1\)
=>\(D=\dfrac{5^{2024}-1}{24}\)
\(S=a^0+a^1+...+a^n\)
=>\(S\cdot a=a^1+a^2+...+a^{n+1}\)
=>\(S\cdot a-S=a^1+a^2+...+a^{n+1}-a^0-a^1-...-a^n\)
=>\(S\left(a-1\right)=a^{n+1}-1\)
=>\(S=\dfrac{a^{n+1}-1}{a-1}\)