199 : 구조체 - 형성평가5
·
코테 문제 풀이/정올
C #include struct info{ char name[20]; int a,b,c; int sum;}; main(){ int n,i,j; scanf("%d",&n); struct info p[n]; struct info tmp; for(i=0;i
198 : 구조체 - 형성평가4
·
코테 문제 풀이/정올
C #include typedef struct info{ int height; double weight;}I; main(){ I mom; I dad; I me; scanf("%d%lf",&mom.height,&mom.weight); scanf("%d%lf",&dad.height,&dad.weight); me.height=(mom.height+dad.height)/2+5; me.weight=(mom.weight+dad.weight)/2-4.5; printf("height : %dcm\n",me.height); printf("weight : %.1lfkg",me.weight);}Colored by Color Scriptercs 출처 : www.jungol.co.kr/bbs/board.php?bo_table=..
197 : 구조체 - 형성평가3
·
코테 문제 풀이/정올
C #include struct point{ int x; int y; int x2; int y2;}; main(){ struct rectangle{ struct point a; struct point b; }; struct rectangle r; scanf("%d%d%d%d",&r.a.x,&r.a.y,&r.a.x2,&r.a.y2); scanf("%d%d%d%d",&r.b.x,&r.b.y,&r.b.x2,&r.b.y2); int minx,maxx,miny,maxy; minx=r.a.x
196 : 구조체 - 형성평가2
·
코테 문제 풀이/정올
C #include #include typedef struct{ char name[50]; char num[50]; char add[50]; }I; main(){ I a[3]; int i,j; char b[50]="zz"; for(i=0;i
618 : 구조체 - 자가진단6
·
코테 문제 풀이/정올
C #include #include typedef struct{ char name[20]; int height; double weight; }info; main(){ info a[5]; int i,j; for(i=0;i
617 : 구조체 - 자가진단5
·
코테 문제 풀이/정올
C #include typedef struct { char name[20]; int height;}info; main(){ info a[5]; int i,flag=0,min=300; for(i=0;i
616 : 구조체 - 자가진단4
·
코테 문제 풀이/정올
C #include 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); } Colored by Color Scripter cs 출처 : www.jungol.co.kr/bbs/board.php?bo_table=pbank&wr_id..
615 : 구조체 - 자가진단3
·
코테 문제 풀이/정올
C #include struct info { char name[20]; int kor; int eng;}; main(){ struct info a,b; scanf("%s%d%d",a.name,&a.kor,&a.eng); scanf("%s%d%d",b.name,&b.kor,&b.eng); printf("%s %d %d\n",a.name,a.kor,a.eng); printf("%s %d %d\n",b.name,b.kor,b.eng); printf("avg %.d %.d",(a.kor+b.kor)/2,(a.eng+b.eng)/2);}Colored by Color Scriptercs 출처 : www.jungol.co.kr/bbs/board.php?bo_table=pbank&wr_id=252&sca=10g0