Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

자료구족발보쌈/0527

From ZeroWiki
Revision as of 07:07, 27 May 2015 by imported>박인서
  이제부터 자료구조를 들어가는 군요...

참여자 명단

함장 장용운 11학번 출석
선원 천준현 15학번 출석
최지혁 출석
박인서 출석
이정재 출석
이원준 출석
조종현 출석
남헌 출석

수업

진행

  1. 장소 : 6층 학회실
  2. 시간 : 11시 ~ 13시

내용

수심 500m. 구조체

  • 구조체, 포인터
  • 연결 리스트

코드

예제1

숙제

  1. 스터디 시간에 짠 소스 코드 업로드 하기


숙제 제출

천준현

최지혁

박인서

  • 구조체 연습
#include <stdio.h>
struct A{
	int id;
	int score;
};

int main(){
	int i,j,temp;
	struct A p[5];
	for(i=0;i<5;i++) scanf("%d",&p[i].id);
	for(i=0;i<5;i++) scanf("%d",&p[i].score);
	for(i=0;i<5;i++){
		for(j=i+1;j<5;j++){
			if(p[i].score<p[j].score){
				temp=p[i].score;
				p[i].score=p[j].score;
				p[j].score=temp;
				temp=p[i].id;
				p[i].id=p[j].id;
				p[j].id=temp;
			}
		}
	}
	for(i=0;i<5;i++) printf("학번 : %d, 점수 : %d\n",p[i].id,p[i].score);
	return 0;
}
  • malloc 실습
#include <stdio.h>
#include <stdlib.h>

int main()
{
	int n,i;
	int * p;
	scanf("%d",&n);
	p=(int *) malloc(sizeof(int)*n);
	for(i=0;i<n;i++) scanf("%d",&p[i]);
	printf("\n");
	for(i=n-1;i>=0;i--) printf("%d\n",p[i]);
	free(p);
	return 0;
}

이정재

이원준

조종현

남헌



활동지도/2015 자료구족발보쌈