1.ç¨Cè¯è¨è¡¨ç¤ºï¼ã F(x) = log2(x) 0<x<10 ã
ç¨Cè¯è¨è¡¨ç¤ºï¼ã F(x) = log2(x) 0<x<10 ã
è¿é¢æä»ä¹é¾ç¹åï¼ç´æ¥åä¸å°±è¡äºï¼
#include <stdio.h>
#include <math.h>
/
*F(x)
= log2(x) 0<x<
= |x|+sin(x) x<0
=0 x=0
=x^2 x>=
*/
double F(double x)
{
return (0<x && x<)
?语言l源码c语言网页写post源码 log(x)/log(2)
: (x<0)
? fabs(x) + sin(x)
: (x == 0)
? 0
: x*x;
}
int main(int argc, char *argv[])
{
int T;
double x;
while(scanf("%d",&T) !=EOF)
{
while(T--)
{
scanf("%lf",&x);
printf("%.2lf\n",F(x));
}
}
return 0;
}