c언어2차원평면1 [C언어] 2차원 평면에서 두 점의 좌표가 일치하면 1을 반환하고 그렇지 않으면 0을 반환하는 함수 int equal(struct point p1, struct point p2)를 작성하시오 공부하시는데에 도움이 되셨으면 좋겠습니다 코드확인해주세요! 더보기 #include struct point { int x, y; } ; int equal(struct point p1, struct point p2); int main(void) { struct point p1= { 1, 2 } ; struct point p2= { 3, 5 } ; printf("일치 여부 = %d\n", equal(p1, p2)); return 0; } int equal(struct point p1, struct point p2) { if( p1.x == p2.x && p1.y == p2.y ) return 1; else return 0; } 더 많은 C언어 글이 궁금하다면? https://chuinggun.tistory.c.. 2020. 5. 5. 이전 1 다음