游客 Signup | Login
中文 | En

1118 - C语言3.3

求以下算术表达式的值:

x+a%3*(int)(x+y)%2/4

Input

只有一行,包含三个数x,a,y,用空格隔开。其中x和y是浮点数,a是整数。

Output

输出题目描述中表达式的值并保留6位小数。注意行尾输出换行。

Examples

Input

2.5 7 4.7

Output

2.500000

Solution C

#include<stdio.h>
int main(){
int a;
double x,y;
scanf("%lf %d %lf",&x,&a,&y);
printf("%.6lf\n",x+a%3*(int)(x+y)%2/4);
return 0;
}

Solution C++

#include <stdio.h>
int main() {
	double x, y, ans;
	int a;
	scanf("%lf %d %lf", &x, &a, &y);
	ans = x + a % 3 * (int)(x + y) % 2 / 4;
	printf("%.6f\n", ans);
	return 0;
}

Time Limit 1 second
Memory Limit 32 MB
Discuss Stats
上一题 下一题