목록대학교 2학년 1학기 (12)
printf("ho_tari\n");
#include #include #include #define _CRT_SECURE_NO_WARNINGS typedef struct NODE { int no; char name[20]; int age; struct NODE* next; }NODE; struct NODE* search(NODE* list, NODE* p) { int q; printf("input number to search: "); scanf_s("%d", &q); p = list; while (p != NULL) { if (q == p->no) { printf("search %d %s %d \n", p->no, p->name, p->age); break; } else { p = p->next; } } return p; } struct ..
#include #include #define QUEUE_SIZE 5 int menu_queue(int*); int input_data(int*); int addq(int); int deleteq(void); int end_queue(void); int queue[QUEUE_SIZE]; int front = 0; int rear = 0; int main(void) { int nSelete = 0, nData = 0, nRetry = 1, rData = 0; while (nRetry) { menu_queue(&nSelete); switch (nSelete) { case 1: input_data(&nData); addq(nData); break; case 2: rData = deleteq(); break; ..
#define _CRT_SECURE_NO_WARNINGS #include int sum(int a, int b) { return a + b; } int mul(int a, int b) { return a * b; } int max(int a, int b) { if (a > b) return a; else return b; } int main() { int funcNumber; int num1, num2; int(*fp)(int, int) = NULL; while (1) { printf("============================"); printf("\n1. sum 2 integer\n"); printf("2. mul 2 integer\n"); printf("3. return bigger inte..
#include #include #include int main(void) { int a; int** A = { 0, }; int** B = { 0, }; int** C = { 0, }; int i, j; int x, y; int b, c, d; int sum; srand((unsigned int)time(NULL)); printf("input matrix size= "); scanf_s("%d", &a); A = (int**)malloc(sizeof(int*) * a); printf("\nFirst matrix = \n"); for (i = 0; i < a; i++) { A[i] = (int*)malloc(sizeof(int) * a); } for (i = 0; i < a; i++) { for (j =..