文件名称:chaofan
介绍说明--下载内容均来自于网络,请自行研究使用
#include<iostream>
using namespace std
int s[100005]
int main()
{
int i,j,k,sum,n
while(scanf(" d",&n)!=EOF)
{
for(i=0 i<n i++)
scanf(" d",&s[i])
sort(s,s+n)
for(i=sum=0 i<n i++)
{
sum += s[i] * (n - i)
}
printf(" d\n",sum)
}
return 0
}
-# include <iostream> using namespace std int s [100005] int main () (int i, j, k, sum, n while (scanf ( " d" , & n)! = EOF) (for (i = 0 i <n i++)
scanf(" d",&s[i])
sort(s,s+n)
for(i=sum=0 i<n i++)
{
sum+= s[i]* (n- i)
}
printf(" d\n",sum)
}
return 0
}
using namespace std
int s[100005]
int main()
{
int i,j,k,sum,n
while(scanf(" d",&n)!=EOF)
{
for(i=0 i<n i++)
scanf(" d",&s[i])
sort(s,s+n)
for(i=sum=0 i<n i++)
{
sum += s[i] * (n - i)
}
printf(" d\n",sum)
}
return 0
}
-# include <iostream> using namespace std int s [100005] int main () (int i, j, k, sum, n while (scanf ( " d" , & n)! = EOF) (for (i = 0 i <n i++)
scanf(" d",&s[i])
sort(s,s+n)
for(i=sum=0 i<n i++)
{
sum+= s[i]* (n- i)
}
printf(" d\n",sum)
}
return 0
}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
炒饭
....\Debug
....\.....\vc60.idb
....\.....\vc60.pdb
....\.....\炒饭.exe
....\.....\炒饭.ilk
....\.....\炒饭.obj
....\.....\炒饭.pdb
....\炒饭.cpp
....\炒饭.dsp
....\炒饭.dsw
....\炒饭.ncb
....\炒饭.opt
....\炒饭.plg
....\Debug
....\.....\vc60.idb
....\.....\vc60.pdb
....\.....\炒饭.exe
....\.....\炒饭.ilk
....\.....\炒饭.obj
....\.....\炒饭.pdb
....\炒饭.cpp
....\炒饭.dsp
....\炒饭.dsw
....\炒饭.ncb
....\炒饭.opt
....\炒饭.plg