Viết hàm tính giá trị F(a) = a^4
Viết thân chương trình nhập vào 2 số nguyên x ,y tính và suất ra màn hình giá trị
T = F(x) + F(y)
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.
![](https://rs.olm.vn/images/avt/0.png?1311)
Câu 1:
#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
cin>>n;
int t=0;
while (n>0)
{
int x=n%10;
t=t+x;
n=n/10;
}
cout<<t;
return 0;
}
![](https://rs.olm.vn/images/avt/0.png?1311)
#include <bits/stdc++.h>
using namespace std;
int main() {
double x, y;
cin >> x;
if(x<0) {cout << "Khong co y thoa man bieu thuc tren";}
if(x>=0)
{y=cbrt(x)+sqrt(x)+1;
cout << y << endl;}
return 0;
}
Chúc bn học tốt!
![](https://rs.olm.vn/images/avt/0.png?1311)
Câu 2:
Program nii;
Uses crt;
Var a,b,c,A:integer;
Begin
Write ('nhap a');
Readln (a);
Write ('nhap b');
Readln (b);
Write ('nhap c');
Readln (c);
A:=a;
If A<b then A:=b;
If A<c then A:=c;
Write ('Ket qua',A);
Readln;
End.
Câu 1
Program ntg;
Uses crt;
Var A,x,y:integer;
Begin
Write ('nhap x');
Readln (x);
Write ('nhap y');
Readln ('y');
A:=x+y;
Write ('Ket qua',A);
Readln;
End.
![](https://rs.olm.vn/images/avt/0.png?1311)
Bài 2:
#include <bits/stdc++.h>;
using namespace std;
int main();
{
long m,n;
cout<<"Nhap m="; cin>>m;
cout<<"Nhap n="; cin>>n;
cout<<m*n-2;
return 0;
}
Câu 6:
Hàm tính giá trị \(F\left(a\right)=a^4\)
function tinhham(a:integer):integer;
begin
tinhham:=a*a*a*a;
end;