목록대학교 2학년 1학기/데이터구조 (9)
printf("ho_tari\n");
#include int main(void) { char A[11]; char temp; printf(“입력: ”); for(int i = 0; i *c ? bst : *c; smt = *a = *a && *c = *b && *c
#include #define pi 3.14 int rectangle(int b, int c); float circle(int r); int triangle(int d, int e); int main(void) { int b,c,d,e; int r; char a; printf(“입력: ”); scanf(“%c”, &a); if(a == ‘r’) { printf(“가로: ”); scanf(“%d”, &b); printf(“세로: ”); scanf(“%d”, &c); printf(“The area of the rectangle is %d squares meters.\n”, rectangle(b,c)); } if(a == ‘c’) { printf(“반지름: ”); scanf(“%d”, &r); printf(“..
#include int main(void) { int a, b,; int sum; int a1[1000]; int a2[1000]; int a3[1000]; int count = 0; printf(“두 개의 정수를 입력하시오: ”); scanf(“%d %d”, &a, &b); sum = a + b; printf(“10진수: %d + %d = %d\n”,a,b,sum); printf(“8진수: %o + %o = %o\n”,a,b,sum); printf(“16진수: %x + %x = %x\n”,a,b,sum); if(a == 0) { printf(“0”); } for(int i = 0; a>0; i++) { a1[i] = a%2; a=a/2; count++; } printf(“2진수: ”); for(int ..
#include int main(void) { int a; int b; printf(“양의 정수를 입력하시오:”); scanf(“%d”, &a); b = a % 3; if(b=33 & a
#include #include typedef struct cnode { int data; struct cnode* next; }CNODE; int getCLlength(CNODE* head) { struct cnode* cur = head; int count = 0; if (head == NULL) { printf("[+]CL length: 0\n"); return 0; } else { cur = cur->next; count++; while (cur != head) { cur = cur->next; count++; } printf("[+]CL length:%d\n", count); } } void printCL(CNODE* head) { CNODE* p; if (head == NULL) { print..
#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..