Giúp mik bài 3 với ạ đang cần gấp
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 st:string;
d,i,t,x,y,a,b:integer;
begin
clrscr;
readln(st);
d:=length(st);
for i:=1 to d do write(st[i]:4);
writeln;
t:=0;
for i:=1 to d do
begin
val(st[i],x,y);
t:=t+x;
end;
writeln(t);
val(st[d],a,b);
if (a mod 2=0) then write(1)
else write(-1);
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n,t,dem,t1;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
t=0;
for (i=1; i<=n; i++) if (a[i]%2==0) t+=a[i];
cout<<t<<endl;
t1=0;
dem1=0;
for (i=1; i<=n; i++)
if (a[i]<0)
{
cout<<a[i]<<" ";
t1+=a[i];
dem1++;
}
cout<<endl;
cout<<fixed<<setprecision(1)<<(t1*1.0)/(dem1*1.0);
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long a,b;
//chuongtrinhcon
long long gcd(long long a,long long b)
{
if (b==0) return(a);
return gcd(b,a%b);
}
//chuongtrinhchinh
int main()
{
cin>>a>>b;
cout<<max(a,b)<<endl;
cout<<gcd(a,b)<<endl;
if ((a>0 && b>0) or (a<0 && b<0)) cout<<a/gcd(a,b)<<" "<<b/gcd(a,b);
else cout<<"-"<<-a/gcd(-a,b)<<" "<<b/gcd(-a,b);
return 0;
}
a) \(A=\sqrt{1-x}+\sqrt{1+x}\)
\(\Rightarrow A^2=1-x+1+x+2\sqrt{\left(1-x\right)\left(1+x\right)}=2+2\sqrt{1-x^2}\)
Do \(-x^2\le0\Rightarrow1-x^2\le1\Rightarrow A^2=2+2\sqrt{1-x^2}\le2+2=4\)
\(\Rightarrow A\le2\)
\(maxA=2\Leftrightarrow x=0\)
Áp dụng bất đẳng thức: \(\sqrt{x}+\sqrt{y}\ge\sqrt{x+y}\)(với \(x,y\ge0\))
\(\Leftrightarrow\left(\sqrt{x}+\sqrt{y}\right)^2\ge x+y\)
\(\Leftrightarrow x+y+2\sqrt{xy}\ge x+y\Leftrightarrow2\sqrt{xy}\ge0\left(đúng\right)\)
\(A=\sqrt{1-x}+\sqrt{1+x}\ge\sqrt{1-x+1+x}=\sqrt{2}\)
\(maxA=\sqrt{2}\Leftrightarrow\)\(\left[{}\begin{matrix}1-x=0\\1+x=0\end{matrix}\right.\)\(\Leftrightarrow\left[{}\begin{matrix}x=1\\x=-1\end{matrix}\right.\)
Câu 3:
a: Ta có: \(2x\left(3x-1\right)-\left(x-3\right)\left(6x+2\right)\)
\(=6x^2-2x-6x^2-2x+18x+6\)
=14x+6
b: Ta có: \(2x\left(x+7\right)-3x\left(x+1\right)\)
\(=2x^2+14x-3x^2-3x\)
\(=-x^2+11x\)
Câu 2:
a: Ta có: \(\left(-8x^5+12x^3-16x^2\right):4x^2\)
\(=-8x^5:4x^2+12x^3:4x^2-16x^2:4x^2\)
\(=-2x^3+3x-4\)
b: Ta có: \(\left(12x^3y^3-18x^2y+9xy^2\right):6xy\)
\(=12x^3y^3:6xy-18x^2y:6xy+9xy^2:6xy\)
\(=2x^2y^2-3x+\dfrac{3}{2}y\)
c: Ta có: \(\dfrac{x^3-11x^2+27x-9}{x-3}\)
\(=\dfrac{x^3-3x^2-8x^2+24x+3x-9}{x-3}\)
\(=x^2-8x+3\)
d: Ta có: \(\dfrac{6x^4-13x^3+7x^2-x-5}{3x+1}\)
\(=\dfrac{6x^4+2x^3-15x^3-5x^2+12x^2+4x-5x-\dfrac{5}{3}-\dfrac{10}{3}}{3x+1}\)
\(=2x^3-5x^2+4x-\dfrac{5}{3}-\dfrac{\dfrac{10}{3}}{3x+1}\)