6 条题解

  • -2
    @ 2025-3-8 20:31:34

    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;
    }
    
    

    【深基2.例11】[NOIP2017 普及组] 成绩

    信息

    ID
    30
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    219
    已通过
    74
    上传者