|
|
вернуться в форумI've got WA N2 here is my cpp program it works very good on my pc can you say me what's wrong with my program? #include <iostream> #include <algorithm> #include <string> using namespace std; void main(){ int i,n,m,pasuxebi[9999],passes[9999]; double percent; cin >> n >> m; for ( i=0;i<m;i++) cin >> pasuxebi[i]; for (i=0;i<m;i++){ if (passes[pasuxebi[i]]<0) passes[pasuxebi[i]]=0; passes[pasuxebi[i]]+=1; } for (i=1;i<=n;i++){ percent=(double)passes[i]*100/m; if ((int)percent>=10){ cout.precision (4);}else{cout.precision(3);} cout << showpoint << percent <<'%' << endl; } system("PAUSE"); } Edited by author 13.02.2009 20:36 |
|
|