Contents

Develop
2015.10.13 16:11

[c] 기막힌 정렬 코드 ㅋㄷ

Views 955 Comment 0
Atachment
Attachment '1'
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

정말 기가 막히는 구나 ㅋㅋ;

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

int main(int c, char **v)
{
    while(--c > 1 && !fork());
    sleep(c = atoi(v[c]));
    printf("%d\n", c);
    wait(0);
    return 0;
}

 

실행화면

sc.png


같은 코드를 JS 코드로 하면..

(function(arr){
    for(var i=0; i<arr.length; i++){
        var n=arr[i];
        setTimeout((function(n){
            return function(){
                console.log(n);
            }
        })(n), n);
    }
})([10, 1, 4, 2, 6, 3, 8, 5]);

 


?

List of Articles
No. Category Subject Author Date Views
793 Develop [jsp][php] 간단한 강좌 자료.. file hooni 2003.04.23 8141
792 Develop [c] 학생명단 관리 프로그램 소스 ㅋㅋ 1 file hooni 2003.04.23 7802
791 Develop [c] 근의 공식으로 2차방정식 풀기.. file hooni 2003.04.23 7809
790 Develop [c] 이진트리(binary tree)의 운행.. hooni 2003.04.23 8296
789 Develop [c] 이진트리(binary tree)의 특성 file hooni 2003.04.23 9632
788 Develop [자료구조] 트리(tree) 용어정리 file hooni 2003.04.23 11103
787 Develop [c] 농구팀 점수 산출 프로그램 소스 file hooni 2003.04.23 7406
786 Develop [c] 단어 입력/수정 프로그램 소스 file hooni 2003.04.23 7052
785 Develop [c] 정사각배열의 서브 배열의 최대 값 구하기 file hooni 2003.04.23 7040
784 Develop [c] 이진트리(binary tree) 샘플소스 (삽입, 삭제, 운행) file hooni 2003.04.23 7835
783 Develop [java] 컴포넌트 배치 ㅡ.,ㅡ; hooni 2003.04.23 7176
782 Develop [html] 메타태그 사용예.. 은지나 바라~ hooni 2003.04.23 7249
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 71 Next
/ 71