Contents

Develop
2015.10.13 16:11

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

Views 812 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
1017 Develop [ios] 기본 네비게이션바의 타이틀, back버튼 위치와 속성 변경 file hooni 2016.05.16 2089
1016 Develop [ios] UUID 생성 + Key Chain 연동 file hooni 2016.05.13 4666
1015 Develop [c#] 전자금융보안론 발표/설치 자료(툴바 소스코드) secret hooni 2016.05.07 0
1014 PPT [ppt] 전자금융보안론 발표/설치 자료 file hooni 2016.05.03 1330
1013 Develop XE Core 1.8.18 본문 작성시 태그(html) 사라지는 버그 file hooni 2016.04.21 868
1012 Develop [io] Apple Watch, Today Extension 앱ID 설정 hooni 2016.04.20 796
1011 Develop [ios] Did UIScrollView End Scrolling? hooni 2016.04.19 1024
1010 Develop [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Swift) file hooni 2016.03.23 7336
1009 Develop [ios] How To Use UIScrollView to Scroll and Zoom Content (Using Objective-C) file hooni 2016.03.23 1615
1008 Develop [js] AngularJS 란? file hooni 2015.11.26 890
1007 PPT [ppt] OCB기술개발팀 OJT 자료 file hooni 2015.11.13 1155
1006 Develop [php] 한글 문자열 자르기 (utf-8) hooni 2015.11.10 1321
Board Pagination Prev 1 ... 9 10 11 12 13 14 15 16 17 18 ... 98 Next
/ 98