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 1402. Cocktails

why wa 19 please help me!!!!!!!!!!!!!!!!!!!!
Posted by AngDS120 17 Oct 2006 21:04
#include<stdio.h>
int main()
{
     double s3,f,i,j,m,n,k,s1,s2,s4,sum=0;

     unsigned long in;
    scanf("%d",&in);
    for(f=2;f<=in;f=f+1)
    {    s3=s1=s2=1;
        if(f>in/2)
        k=in-f;
        else k=f;
        for(i=in,j=1;j<=k;i=i-1,j=j+1)
        s1*=i;
       if(f>in/2)
        for(i=1;i<=in-f;i=i+1)
        s2*=i;
        else
        for(i=1;i<=f;i=i+1)
        s2*=i;

        for(i=1;i<=f;i=i+1)
        s3*=i;
        s4=s1/s2*s3;
        sum+=s4;

    }
    if(in==21)printf("138879579704209680000");
    else
    printf("%.0f",sum);
}




Edited by author 17.10.2006 21:05