본문 바로가기

IT

Algorithm: 프랙탈 그래픽(Fractal Graphic) 소용돌이 #include #include #include int x,y;int t = 100; void gotoxy(int x, int y);void delay(clock_t n);void left();void right();void up();void down(); void main(){int i,j;x = 15;y = 15;gotoxy(x,y);printf("A");delay(1000);for(i=1; i 더보기
Algorithm: 피보나치 수열(Fibonacci sequence) #include int fibonacci(int frq); void main(){int frq;int fibo; printf("몇회 진행 하시겠습니까? ");scanf("%d",&frq);fibo = fibonacci(frq);printf("%d\n",fibo);} int fibonacci(int frq){int i;int default_num1, default_num2, temp; default_num1 = 1;default_num2 = 1; for(i=0; i 더보기
Algorithm: 계승(Factorial) #include int fatorial(int num); void main(){int num;int ftr; scanf("%d",&num);ftr = fatorial(num);printf("%d\n",ftr);} int fatorial(int num){if(num == 0){return 1;}elsereturn num * fatorial(num-1);} 더보기
Algorithm: 큐(Queue) 동적 활당을 이용한 큐 #include #include void main(){int n,q,qsize;int num[100];int *queue;puts("How much do u want to have size of Q? ");scanf("%d",&qsize);queue = (int*)malloc(qsize); for(n=0; nname = name;temp->link = head;}else if(h->link !=head){while(h->link != head){h = h->link;}h->link = temp;temp->name = name;temp->link = head;}} void print_node(){node *temp;temp=head->link;while(temp->link != he.. 더보기
Algorithm: 이중 연결 리스트(Doubly linked list) #include #include typedef struct _dnode{int name;struct _dnode *pre_link;struct _dnode *nxt_link;}dnode; dnode *head;dnode *tail; void init();void ordered_insert(int name);void nexted_insert(int std_name, int nxt_name); void print_dnode();void del(int name);void modify(int std_name,int mod_name); void main(){init();ordered_insert(1);ordered_insert(2);ordered_insert(3);ordered_insert(4);ordered_i.. 더보기
Algorithm: 링크드리스트(Linked list) #include #include typedef struct _node {int name;struct _node *link;} node; node *head, *tail; void init();void odered_insert(int name);void nexted_insert(int k);void print_node();node* find(int name);void del(int name);void modify(int std_name,int mod_name); void main(){node *temp; init();odered_insert(1);odered_insert(2);odered_insert(3);odered_insert(4);odered_insert(5);modify(5,7);nexted_ins.. 더보기
PLC: TIMER 더보기
PLC: Flip-Flop 더보기
PLC: 히라다맵과 레더 총연산시간 + 결과출력시간 = 엣지상승시간 + 엣지하강시간 더보기
PLC: 버튼 눌렀다 때는 순간 동작 더보기