[ create a new paste ] login | about

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

C, pasted on Dec 11:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>
#include <math.h>

int main(void)
    {
    double x1, x2, y1, y2, sq;

    printf("x1 : ");
    scanf("%lf", &x1);
    printf("y1 : ");
    scanf("%lf", &y1);
    printf("x2 :");
    scanf("%lf", &x2);
    printf("y2 : ");
    scanf("%lf", &y2);

    sq = sqrt( (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) );

    printf("この2点間の距離は%fです。", sq);
    return 0;
    }


Create a new paste based on this one


Comments: