1 solutions
-
0
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; }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; }Pascal :
var a:longint; x,y:double; begin readln(x,a,y); writeln( x + a mod 3 * trunc(x+y) mod 2 div 4 :0:6 ); end.Java :
import java.util.*; public class Main { public static void main(String args[]) { Scanner cin = new Scanner(System.in); double x,y; int a; x=cin.nextDouble(); a=cin.nextInt(); y=cin.nextDouble(); double r = x+a%3*(int)(x+y)%2/4; System.out.printf("%.6f",r); } }Python :
x = raw_input().split() x,a,y = float(x[0]),int(x[1]),float(x[2]) print "%.6f" %(x+a%3*(int)(x+y)%2/4)
- 1
Information
- ID
- 16399
- Time
- 1000ms
- Memory
- 32MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By