|
|
вернуться в форумI have WA10!!! Послано vakhid 13 фев 2014 14:18 #include <iostream> using namespace std; int main() { int n; cin>>n; double a[n]; double s=0; for (int i=0;i<n;i++) {cin>>a[i];s+=a[i];} double sr=s/(n+1);double p=0; for (int i=0;i<n;i++) if (a[i]>sr) {p+=a[i]-sr;} for (int i=0;i<n;i++) { if (a[i]>sr) cout<<(int)(100*(a[i]-sr)/(p-0.0001))<<" "; else cout<<"0"<<" "; } return 0; } If you have give me please test 10... Re: I have WA10!!! I think this is right: if (a[i]>sr) cout<<(int)(100*(a[i]-sr)/p + 1e-10)<<" "; Edited by author 18.10.2014 17:28 |
|
|