[ create a new paste ] login | about

Link: http://codepad.org/LX0CLp9l    [ raw code | fork ]

C, pasted on Oct 11:
#include <stdio.h>
#include <math.h>
int main (){

    int n,x;
    double x1,x2,y1,y2,value1, value2, main;

    scanf("%d",&n);

    for(x=1; x<=n; x++){

        scanf("%lf",&x1);
        scanf("%lf",&y1);
        scanf("%lf",&x2);
        scanf("%lf",&y2);
        value1 = (x2 - x1)*(x2-x1);
        value2 = (y2 - y1)*(y2-y1);
        main = value1 + value2;
        main = sqrt(main);
        printf("Case %d: %0.4lf\n",x,main);


    }

    return 0;

}


Output:
No errors or program output.


Create a new paste based on this one


Comments: