C언어272 [c언어] 다항식 리스트를 생성 덧셈 추가 출력하는 함수를 작성하고 테스트하는 프로그램을 작성하시오 공부하시는대에 도움이 됐으면 좋겠습니다. 답안코드 확인해주세요! 더보기 #include #include // 다항식 리스트의 노드 구조를 구조체로 정의 float coef; typedef struct ListNode { float coef; int expo; struct ListNode* link; } ListNode; // 다항식 리스트의 head 노드를 구조체로 정의 typedef struct ListHead { ListNode* head; } ListHead; // 공백 다항식 리스트를 생성하는 연산 ListHead* createLinkedList(void) { ListHead* L; L = (ListHead *)malloc(sizeof(ListHead)); L->head = NULL; return.. 2022. 12. 10. [c언어] 이중 연결 리스트를 작성하는 프로그램을 작성하고 테스트하시오 공부하시는대에 도움이 됐으면 좋겠습니다. 답안코드 확인해주세요! 더보기 #include #include #include // 이중 연결 리스트의 노드 구조를 구조체로 정의 typedef struct ListNode { struct ListNode* llink; // 왼쪽(선행) 노드에 대한 링크 char data[4]; struct ListNode* rlink; // 오른쪽(다음) 노드에 대한 링크 } listNode; // 리스트 시작을 나타내는 head 노드를 구조체로 정의 typedef struct { listNode* head; } linkedList_h; // 공백 이중 연결 리스트를 생성하는 연산 linkedList_h* createLinkedList_h(void) { linkedList_h*.. 2022. 12. 10. [c언어] 원형 연결 리스트를 생산하고 삽입하는 프로그램을 작성하시오 공부하시는대에 도움이 됐으면 좋겠습니다. 답안코드 확인해주세요! 더보기 #include #include #include // 원형 연결 리스트의 노드 구조를 구조체로 정의 typedef struct ListNode { char data[4]; struct ListNode* link; } listNode; // 리스트의 시작을 나타내는 head 노드를 구조체로 정의 typedef struct { listNode* head; } linkedList_h; // 공백 원형 연결 리스트를 생성하는 연산 linkedList_h* createLinkedList_h(void) { linkedList_h* CL; CL = (linkedList_h*)malloc(sizeof(linkedList_h));// 헤드 노드 할당.. 2022. 12. 10. [C언어] 파일을 열어 특정한 문자를 만나면 count를 증가시키는 프로그램을 작성하시오 더보기 #include int main(int argc, char *argv[]) { int numA=0, numP=0; char word[50]; //세상에서 가장 긴 단어가 45글자. FILE* file; int state; if(argc!=2) { printf("usage : word test.txt \n"); return 1; } file = fopen(argv[1], "rt"); if(file==NULL) { printf("file open error! \n"); return 1; } while(1) { fscanf(file, "%s", word); if(feof(file)!=0) break; if(word[0]=='A' || word[0]=='a') numA++; if(word[0]=='P' .. 2022. 12. 7. 이전 1 ··· 19 20 21 22 23 24 25 ··· 68 다음