열혈 ( c ) chapter 22-구조체의 정의
#include #include struct point { int xpos; int ypos; }; int calculate(int A, int B,int C,int D) { return sqrt((A - B) * (A - B) + (C - D) * (C - D)); } int main(void) { struct point pos1, pos2; double distance; fputs("point1 pos: ", stdout); scanf("%d %d", &pos1.xpos, &pos1.ypos); fputs("point2 pos: ", stdout); scanf("%d %d", &pos2.xpos, &pos2.ypos); distance = calculate(pos1.xpos, pos2.xpos, po..