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

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