Các hàm toán học bản 2

View as PDF

Time limit: 1.0s , Memory limit: 256M , Points: 1 (partial)

Viết chương trình tính giá trị hàm số sau: f(x) = lg^3(a) + cos^5(x), trong đó a=c^4+k^3, c= \sqrt{|x|}.

Input

Dòng duy nhất chứa hai số thực x, k thỏa 1 \le x, k \le 100.

Output

In ra kết quả của hàm với 2 chữ số sau dấu chấm thập phân.

Samples

Sample Input 1
5 8.2
Sample Output 1
21.04

Comments


  • 0
    25T1020086  commented on Oct. 7, 2025, 8:31 a.m.

    include <bits/stdc++.h>

    using namespace std;

    int main() {

    double x,k; cin >> x >> k;
    double c = sqrt(fabs(x));
    double a = pow(c, 4) + pow(k, 3);
    
    double fx = pow(log10(a), 3) + pow(cos(x), 5);
    
    cout << fixed << setprecision(2) << fx;
    
    return 0;

    }


    • 0
      25T1020086  commented on Oct. 7, 2025, 8:10 a.m.

      include <bits/stdc++.h>

      using namespace std;

      int main() {

      double x,k; cin >> x >> k;
      double c = sqrt(fabs(x));
      double a = pow(c, 4) + pow(k, 3);
      
      double fx = pow(log10(a), 3) + pow(cos(x), 5);
      
      cout << fixed << setprecision(2) << fx;
      
      return 0;

      }


      • 2
        24t1020417  commented on Oct. 21, 2024, 1:31 a.m.

        include <iostream>

        include <cmath>

        include <iomanip>

        using namespace std;

        int main(){ double x, k; cin >> x >> k; double c = sqrt(fabs(x)); double a = pow(c, 4) + pow(k, 3); double lg_a_cubed = pow(log10(a), 3); double cos_x_fifth = pow(cos(x), 5);

        double result = lg_a_cubed + cos_x_fifth;
        
        cout << fixed << setprecision(2) << result << endl;
        return 0;

        }


        • 0
          24T1020174_Hungg  commented on Sept. 13, 2024, 6:55 a.m.

          Viết đúng hàm mà sao kq không khớp nhỉ


            • 1
              22T1020183  commented on Sept. 13, 2024, 9:35 a.m.

              có thể bạn viết bị hàm sai mới kq không khớp á.


            • 0
              23t1050023  commented on Oct. 8, 2023, 7:02 a.m.

              dạ cho e hỏi f(x) và a,c khai báo như thế nào ạ


              • 0
                23T1020527  commented on Sept. 22, 2023, 8:31 a.m.

                Cho mình hỏi cái cos mũ 5(x)viết theo c++ thì như thế nào ạ


                  • 7
                    Justinianus  commented on Sept. 22, 2023, 9:34 a.m.

                    pow(cos(x), 5) nhé bạn