Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
4349 A班-过懿萱 买不买 C++ 通过 100 1 MS 296 KB 416 2025-01-11 11:07:13

Tests(2/2):


#include <bits/stdc++.h> using namespace std; int main() { int n,temp = 0; cin>>n; int a[10010]; int max = a[1]; for(int i = 1;i <= n;i++) { cin>>a[i]; } for(int i = 1;i <= n;i++) { temp += a[i]; if(a[i] > max) { max = a[i]; } } if(temp > 100) { cout<<"Yes"<<endl; cout<<temp - max<<endl; } else { cout<<"No"<<endl; cout<<temp<<endl; } return 0; }


测评信息: