Contents

Develop
2015.10.13 16:11

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

조회 수 966 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
1005 Develop [ios] How to set up clang formatter hooni 2015.09.17 1473
1004 Etc ISMS 인증기준 – 정보보호대책 (시스템개발보안) file hooni 2016.12.01 1476
1003 Etc 모바일 프로그래머가 갖추어야 할 필수 역량 file hooni 2017.02.16 1493
1002 System/OS Configure Postfix to Use Gmail SMTP on Ubuntu 18.04 file hooni 2020.02.07 1495
1001 Develop [ios] Swift 4 String, Date, DateFormatter 예제 hooni 2018.10.18 1512
1000 System/OS RPA란? 어디에 어떻게 쓰이고 누가 만드나? file hooni 2020.01.28 1516
999 Etc 아이폰의 터치스크린 정확도 file hooni 2015.04.01 1518
998 System/OS How to Install and Use wget on Mac file hooni 2020.09.03 1535
997 System/OS SSH Passwordless Login Using SSH Keygen in 5 Easy Steps file hooni 2019.11.22 1540
996 Develop What is difference between Get, Post, Put and Delete? hooni 2018.02.28 1568
995 Develop [swift] popToRoot 모달뷰, 네비게이션컨트롤러 한꺼번에 닫기 file hooni 2021.01.29 1572
994 Develop How to Test SMTP AUTH using Telnet hooni 2018.04.05 1589
Board Pagination Prev 1 ... 10 11 12 13 14 15 16 17 18 19 ... 98 Next
/ 98