| 
 | 
back to boardtest 1 Posted by  giorgi 15 Dec 2011 01:53 #include <stdio.h> #include<string.h>   int main() {     int sel[10010],n,m,tmp,i;     scanf("%d%d",&n,&m);       memset(sel,0,10010*sizeof(int));       for(i=0; i<m; i++) {         scanf("%d",&tmp);         sel[tmp]++;     }       for(i=1; i<=n; i++)         printf("%.2f%\n",((double)sel[i]*(double)100)/(double)m);       return 0; }   whats wrong? Re: test 1 Posted by  giorgi 15 Dec 2011 01:58         printf("%.2f%%\n", problem is here. it needs two % Re: test 1 Why it needs 2 of '%'? Re: test 1 % should also be printed at the end, I just found this mistake :) Re: test 1 I am also amazed by this. My code is working in ideone with single "%". http://ideone.com/cbm8uh   Edited by author 03.01.2015 15:49 |  
  | 
|