ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1263. Elections

Show all messages Hide all messages

test 1 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 giorgi 15 Dec 2011 01:58
        printf("%.2f%%\n",
problem is here. it needs two %
Re: test 1 SpartakusMd 5 Mar 2012 01:58
Why it needs 2 of '%'?
Re: test 1 Nodir NAZAROV Komiljonovich 9 Sep 2012 15:29
% should also be printed at the end, I just found this mistake :)
Re: test 1 Neeraj Kumar 3 Jan 2015 15:47
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