I don't know why WA...but sample input gives correct answer...anyone help me....
#include <stdio.h>
void main(){
long int a, b, c, d, sum,temp;
while(scanf("%ld %ld %ld %ld",&a,&b,&c,&d)){
if(a==0&&b==0&&c==0&&d==0)break;
sum=1080;
temp=(a-b);
if(temp<0)temp=temp*(-1);
sum=sum+360-9*temp ...