数学函数调用 (10 分)
利用库math.h中的相关函数,计算表达式log10(|sin(x)-cos(x/2)+x+168|)的值。
输入格式:
一个实数。
输出格式:
计算并输出上述表达式的值,保留4位小数。
输入样例:
1.57
结尾无空行
输出样例:
1.1243
结尾无空行
#include<stdio.h>
#include<math.h>
int main()
{
double a,b;
scanf("%lf",&a);
b=log10(fabs(sin(a)-cos(a/2)+sqrt(a+168)));
printf("%.4lf",b);
return 0;
}
mm-dd-yyyy to yyyy-mm-dd (10 分)
American usually use day-month-year, but Chinese often use year-month-day. Please write a program to transfer the date from American style to Chinese style.
Input format:
mm-dd-yyyy
Output format:
yyyy-mm-d