이진트리(바이너리트리) 구현 예제

#include <stdio.h> #include <stdlib.h> typedef struct Node { struct Node *left; int num; struct Node *right; }Node; int menu(void); void add(Node **root); void del(Node **root); void inorder(Node *root); Node* search(Node *root, int num); void insertNode(Node **root, int num); void deleteNode(Node **root, int num); int main(void) { Node *root = NULL; while(1) { switch(menu()) { case 1 : add(&root); break; ...

Linked List를 활용한 데이터 관리 예제

#include #include #include #define MAX 255 typedef struct _std{ int no,kor,eng,math; char name[MAX]; float avr; struct _std * next; }std; int main() { std *head = NULL, *cur, *newstd, ** ptr, *temp, *del_ptr, *find_ptr,*pre_ptr; int kno,count, i, j,del_no,find_no; float kko,ken,kma; char str[MAX],tmp; FILE *wfp; while(1) { system("cls"); printf("<< MENU >>n"); printf("1.데이터 입력n"); printf("2.데이터 ...

Lotto Program Created by C

#include <stdio.h> #include <time.h> #include <stdlib.h> void select(float *a); void lottorand(int *a); int check(float *a, int *b); int main() { int i; float mylotto[6]; int lotto[6]; printf("로또번호선택n"); select(mylotto); lottorand(lotto); printf("n내가 선택한 숫자 : "); for(i=0;i<6;i++) { printf("%d ", (int)mylotto[i]); } printf("nn로또당첨번호 : "); for(i=0;i<6;i++) { printf("%d ...

Apply Image Click Effect

add xml format file to /res/drawable <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/image_click" /> <item android:state_focused="true" android:drawable="@drawable/image_focused" /> <item android:drawable="@drawable/image_click" /> </selector> "@drawable/BasicImage" is default image. "@drawable/onClickImage"is focused image. BasicImage ...