#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char *argv[]) {
int x;
double f = 0;
scanf("%d",&x);
if(x < 0){
f = fabs(x);
}
else if(x >= 0 && x < 2){
f = sqrt(x + 1);
}
else if(x >= 2 && x < 4 ){
f = pow((x + 2),5);
}
else f = 2 * x + 5;
printf("%.2lf",f);
return 0;
}
0.0分
0 人评分
2003年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:539 |
2005年春浙江省计算机等级考试二级C 编程题(3) (C语言代码)浏览:385 |
C语言训练-求矩阵的两对角线上的元素之和 (C语言代码)浏览:598 |
九宫重排 (C++代码)浏览:1325 |
不容易系列 (C语言代码)浏览:660 |
C语言程序设计教程(第三版)课后习题7.4 (C语言代码)浏览:1232 |
【蟠桃记】 (C语言代码)浏览:663 |
WU-格式化数据输出 (C语言代码)浏览:1736 |
C语言考试练习题_一元二次方程 (C语言代码)浏览:572 |
printf基础练习2 (C语言代码)浏览:616 |