6 条题解
-
1
张北辰Orz 张北辰Orz 张北辰Orz
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); int a=scanner.nextInt(); int b=scanner.nextInt(); int c=scanner.nextInt(); int ans=(int)(a*0.2+b*0.3+c*0.5); System.out.println(ans); scanner.close(); } }#include<bits/stdc++.h> using namespace std; int a,b,c; int main(){ cin>>a>>b>>c; cout<<0.2*a+0.3*b+0.5*c; return 0; } -
-2
1. Python
s = input().split(" ") # 读取数据 score = 0.2*int(s[0]) + 0.3*int(s[1]) + 0.5*int(s[2]) print(int(score)) # 对结果取整2. C++
#include <bits/stdc++.h> using namespace std; int a, b, c; int score; int main(void){ scanf("%d%d%d", &a, &b, &c); score = 0.2*a + 0.3*b + 0.5*c; printf("%d", score); // 由于10|score, score计算结果为整数 return 0; }
- 1
信息
- ID
- 30
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 6
- 标签
- 递交数
- 219
- 已通过
- 74
- 上传者