|
|
вернуться в форумWA#12 Help! What's wrong with my code? #include <bits/stdc++.h> #define forn( i, n ) for( int i = 0; i < n; i ++ ) using namespace std; int main() { int qq[10000]; int k, l; double m , n; l = 0; cin >> k >> n; forn( i , n) cin >> qq[i]; forn( i, k+1 ){ forn( j , n) if (qq[j] == i) l = l+1; if ( i != 0 ) { m = (l / n * 100); l = (int) round(m*100)/100; if ( l - m == 0) cout << round(m*100)/100 << ".00%" << endl; else cout << round(m*100)/100 << "%" << endl; l = 0; } } return 0; } |
|
|