Contents

Develop
2015.10.13 16:11

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

조회 수 952 댓글 0
Atachment
첨부 '1'
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

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

#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
번호 분류 제목 글쓴이 날짜 조회 수
793 Develop [jsp][php] 간단한 강좌 자료.. file hooni 2003.04.23 8139
792 Develop [c] 학생명단 관리 프로그램 소스 ㅋㅋ 1 file hooni 2003.04.23 7799
791 Develop [c] 근의 공식으로 2차방정식 풀기.. file hooni 2003.04.23 7805
790 Develop [c] 이진트리(binary tree)의 운행.. hooni 2003.04.23 8294
789 Develop [c] 이진트리(binary tree)의 특성 file hooni 2003.04.23 9629
788 Develop [자료구조] 트리(tree) 용어정리 file hooni 2003.04.23 11098
787 Develop [c] 농구팀 점수 산출 프로그램 소스 file hooni 2003.04.23 7403
786 Develop [c] 단어 입력/수정 프로그램 소스 file hooni 2003.04.23 7048
785 Develop [c] 정사각배열의 서브 배열의 최대 값 구하기 file hooni 2003.04.23 7038
784 Develop [c] 이진트리(binary tree) 샘플소스 (삽입, 삭제, 운행) file hooni 2003.04.23 7833
783 Develop [java] 컴포넌트 배치 ㅡ.,ㅡ; hooni 2003.04.23 7176
782 Develop [html] 메타태그 사용예.. 은지나 바라~ hooni 2003.04.23 7248
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 71 Next
/ 71