1 solutions
-
0
C :
#include<stdio.h> int main() { int a,b; scanf("%d%d",&a,&b); printf("%.1f",(a-1)*2.5+b*1.5); return 0; }
C++ :
#include<iostream> #include <iomanip> using namespace std; int main(){ int x,y; cin>>x>>y; cout<<fixed<<setprecision(1)<<((x-1)*2.5+y*1.5)<<endl; }
Java :
import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); double get = (double)((a-1)*2.5+1.5*b); System.out.println( String.format("%.1f", get)); } public static void printArr(int [] a){ for (int i = 0 ;i<= a.length - 1 ;i++) { System.out.print( a[i] + " "); } } }
Python :
s = input().split() x = int(s[0]) y = int(s[1]) a = x - 1 print("%.1f" % (a * 2.5 + y * 1.5))
- 1
Information
- ID
- 10175
- Time
- 1000ms
- Memory
- 64MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By