这题代码量这么大吗
by comfort @ 2019-04-21 17:41:14
@[comfortable](/space/show?uid=103295)
那个。。。我笨。。。。。
by 惟恋葱和鱼 @ 2019-04-21 17:44:06
就问你哪里性感了?
by 小粉兔 @ 2019-04-21 17:54:55
你的码风...
by 我不认识你 @ 2019-04-21 17:55:34
性感的s形曲线码风
by 2661531273zwm @ 2019-04-21 18:02:14
码风性感。。。
by mulberror @ 2019-04-21 18:04:27
@[惟恋葱和鱼](/space/show?uid=149139)
弱鸡只能帮到这了。
```cpp
#include <bits/stdc++.h>
using namespace std;
const int N=123;
int a[N];
int main()
{
int n,tot=0,js=0;
scanf("%d",&n);
for (int i=0;i<n;i++)
{
scanf("%d",&a[i]);
tot+=a[i];
}
tot/=n;
for(int i=0;i<n;i++)
{
a[i]-=tot;
}
for(int i=0;i<n;i++)
{
if(a[i]==0)
continue;
a[i+1]+=a[i];
js++;
}
printf("%d",js);
return 0;
}
```
by Smile_Cindy @ 2019-04-21 18:06:09
@[Alpha](/space/show?uid=87058) 谢谢大佬
by 惟恋葱和鱼 @ 2019-04-22 15:49:17
代码好性感
by 0__o @ 2019-07-27 11:06:14
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,a[110],zh=0,pjs,cs=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
zh=zh+a[i];
}
pjs=zh/n;
for(int i=1;i<=n;i++){
if(a[i]<pjs){
a[i]==pjs;
a[i+1]=a[i+1]-(pjs-a[i]);
cs=cs+1;
}
if(a[i]>pjs){
a[i]==pjs;
a[i+1]=a[i+1]+(a[i]-pjs);
cs=cs+1;
}
}
cout<<cs;
}
by by18067119023 @ 2019-08-28 16:05:56