Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

Getting WA in ATM, can someone help?

$
0
0
#include <stdio.h>
#include <stdlib.h>

int main()
{
int x;
float y,z;
scanf("%d %f",&x,&y);
if((x<=2000) && (y<=2000))
{
 if(x>y)
{
printf("%.2f",y);
return 0;
}

if(x%5==0)
{
    z=(y-x)-.50;
    printf("%.2f",z);
}
else{
z=y;
printf("%.2f",z);
}
}
return 0;
}

Viewing all articles
Browse latest Browse all 39796

Trending Articles