View Code of Problem 448

#include <stdio.h>
int main()
{
    int n;
    scanf("%d",&n);
    double a,b;
    double c,d;
    while(n--)
    {
           scanf("%lf%lf",&a,&b);
            double s1,s2;
            c=b/5;
            d=b/4;
            if(a<=3)
            {
                s1=11+*2;
                s2=11+d*2.5;
            }
            else if(a>3&&a<=10)
            {
                s1=11+c*2+(a-3)*2;
                s2=11+d*2.5+(a-3)*2.5;
            }
            else if(a>10)
            {
                s1=11+7*2+(a-10)*3+c*2;
                s2=11+7*2.5+(a-10)*3.75+d*2.5;
            }
            int x=s1;
            if(s1-x>=0.5)
                x=x+1;
            int y=s2;
            if(s2-y>=0.5)
                y=y+1;
            printf("%d\n",y-x);
    }
    return 0;
}
/*
Main.c: In function ‘main’:
Main.c:16:23: error: invalid type argument of unary ‘*’ (have ‘int’)
                 s1=11+*2;
                       ^
*/

Double click to view unformatted code.


Back to problem 448