KakaoTalk_20190606_001802318.png
  • 246x0w
Welcome
Curriculum
Install&Go
Board
실제 작동 상태를 확인하려면 라이브 사이트로 이동하세요.
  • 카테고리
  • 전체 게시물
  • 내 게시물
이재민
2020년 3월 31일

200331

게시판: 소스 코드 제출

/*

#include <stdio.h>


int main(){



int a=10;

int *p = &a;


printf("a : %d\n",a);

printf("&a : %d\n",&a);

printf("p : %d\n",p);

printf("*p : %d\n",*p);


return 0;

}

*/








/*

void myswap(int *p,int *q)

{

int x;

if (*p>*q){

x=*q;

*q=*p;

*p=x;

}

}

*/






#include <stdio.h>


int n=0;


struct student {

int number;

char name[100];

int score;

};



void dr (struct student *p)

{

printf("등록할 학생의 정보를 입력하세요.\n");

n++;

scanf("%d %s %d",&(*(p+n)).number,(*(p+n)).name,&(*(p+n)).score);

printf("학생이 등록되었습니다.\n");


}







void x (struct student *p)

{

int nn;

printf("삭제할번호:");

scanf("%d",&nn);

for (int i=0; i<n; i++){

if (nn=i){


}

else {

printf("%d %s %d\n",(*(p+i)).number,(*(p+i)).name,(*(p+i)).score);

}

}

}



void edit (struct student *p)

{


}


void print(struct student *p)

{

for (int i=1; i<=n; i++){

printf("%d %s %d\n",(*(p+i)).number,(*(p+i)).name,(*(p+i)).score);

}

}

// 1 이재민 a


int main()

{

int a;


struct student s[100];


while(1)

{

a=0;

printf("==============================\n");

printf("=========번호를 입력하세요==========\n");

printf(" 1.학생 등록하기\n");

printf(" 2.학생 삭제하기\n");

printf(" 3.학생 수정하기\n");

printf(" 4.학생 출력하기\n");


scanf("%d",&a);


if(a==1)

{

dr(s);

}

else if(a==2)

{

x(s);

}

else if(a==3)

{

edit(s);

}

else if(a==4)

{

print(s);

}

}


return 0;


}


댓글 0개
0
댓글
댓글 0개
유사 게시물
  • 200331
  • 200331
  • 200331
주소 : 경기도 용인시 광교중앙로 302 블루 스퀘어 602호
연락처 : 031) 216 - 1546
사업자등록번호 : 465-92-00916
​학원 등록 제 4603호