标签:des style blog color os io for ar div
Description
Input
Output
Sample Input
input | output |
---|---|
3 5 10 3 |
#include<iostream> #include<cstdio> #include<string.h> #include<algorithm> using namespace std; int main() { int n; int a[101]; int sum; while(scanf("%d",&n)!=EOF) { for(int i=0;i<n;i++) scanf("%d",&a[i]); sort(a,a+n); sum=0; for(int i=0;i<n;i++) sum+=a[i]; sum+=a[n-1]; printf("%d\n",sum); } return 0; }
读题吧 亲~~~ 看我下次还能不能读懂!!!!!!!!!!!!!!!!
标签:des style blog color os io for ar div
原文地址:http://www.cnblogs.com/zhangying/p/3930702.html