Tìm giá trị của y như sau:
y = x^3 + 5x, với x ≥ 10
y = x^2 − 2x + 4, với x < 10
Input Dòng duy nhất là số nguyên x thỏa |x| ≤ 105 .
Output In ra kết quả cần tìm.
Examples
standard input 2
standard output 4
Code:
#include <bits/stdc++.h>
using namespace std;
int main()
{
long long x;
cin>>x;
if(x >= 10)
cout<<pow(x,3) + 5*x;
if(x < 10)
cout<<pow(x,2) - 2*x + 4;
return 0;
}