Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
102672 彭林江 短信计费 C++ Accepted 1 MS 280 KB 518 2024-12-22 14:09:37

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; // 自定义函数:1、返回类型、2、函数名、3、参数列表、函数体 double gj(int zs){ double money = 0; if(zs % 70 != 0){ money = zs/70 * 0.1 + 0.1; }else{ money = zs/70*0.1; } return money; } int main(){ int n; // n表示短信条数 cin >> n; int a[1501]; for(int i = 0; i < n; i++){ cin >> a[i]; } double sum = 0; for(int i = 0; i < n; i++){ sum = sum + gj(a[i]); } printf("%.1lf", sum); return 0; }