W 개발 일지

616 : 구조체 - 자가진단4 본문

C/정올 문제풀이

616 : 구조체 - 자가진단4

waVwe 2020. 11. 9. 23:05
반응형

C

#include<stdio.h>
 
struct point {
    int x;
    int y;
};
 
main(){
    struct triangle{
        struct point a;
        struct point b;
        struct point c;
    };
    
    struct triangle t;
    scanf("%d%d",&t.a.x,&t.a.y);
    scanf("%d%d",&t.b.x,&t.b.y);
    scanf("%d%d",&t.c.x,&t.c.y);
    printf("(%.1lf, %.1lf)",(double)(t.a.x+t.b.x+t.c.x)/3,(double)(t.a.y+t.b.y+t.c.y)/3);
}
cs

 

 

 

 

출처 : www.jungol.co.kr/bbs/board.php?bo_table=pbank&wr_id=253&sca=10g0

반응형

'C > 정올 문제풀이' 카테고리의 다른 글

618 : 구조체 - 자가진단6  (0) 2020.11.10
617 : 구조체 - 자가진단5  (0) 2020.11.09
615 : 구조체 - 자가진단3  (0) 2020.11.09
614 : 구조체 - 자가진단2  (0) 2020.11.09
187 : 문자열1 - 형성평가6  (0) 2020.11.05