코테 문제 풀이/정올

616 : 구조체 - 자가진단4

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

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

728x90
반응형