'Coding'에 해당되는 글 358건

  1. 2016.04.13 printf로 디버깅 하기
  2. 2016.03.30 C++ 컴파일러
  3. 2016.03.17 Tetris
  4. 2016.03.17 Lambda function 1
  5. 2016.03.16 Lambda function
  6. 2016.03.03 짝수만 출력하기
  7. 2015.12.23 Couple
  8. 2015.08.28 Mac 에서 Trello PDF로 저장하기
  9. 2014.12.03 Scala 프로그램밍 예제 100제 2
  10. 2014.12.02 스칼라 설치
Coding/CPP 삽질기2016. 4. 13. 17:25

#define DEBUG


#ifdef DEBUG

    #define cprintf(...) printf(__VA_ARGS__)

#else

    #define cprintf(...) 

#endif



'Coding > CPP 삽질기' 카테고리의 다른 글

가장 넓은 직사각형 구하는 알고리즘 ( O(MN) )  (0) 2016.04.13
C++ 컴파일러  (0) 2016.03.30
Lambda function  (1) 2016.03.17
Posted by chobocho
Coding/CPP 삽질기2016. 3. 30. 00:09

무료 C++ 컴파일러



1. 구름 IDE ( https://ide.goorm.io/ )

웹기반 IDE 이며, 기본 사용은 무료 이다.

웹 브라우져만 있으면 손쉽게 다양한 언어로 개발이 가능 하다.




2. C++ shell ( http://cpp.sh )

무료이며, 웹브라우져만 띄우면 짧은 코드를 쉽게 실행 할 수 있다.



3. Cygwin ( http://cygwin.com/install.html )

자세한 설명은 Cygwin 홈페이지를 참고하시면 됩니다.



4. Visual studio Express ( https://www.visualstudio.com/ko-kr/products/visual-studio-community-vs.aspx )

너무 유명하므로 설명은 생략 합니다.


'Coding > CPP 삽질기' 카테고리의 다른 글

printf로 디버깅 하기  (0) 2016.04.13
Lambda function  (1) 2016.03.17
Lambda function  (0) 2016.03.16
Posted by chobocho
Coding/Java 삽질기2016. 3. 17. 02:44



심심해서 다시 만들어 보는 테트리스


Posted by chobocho
Coding/CPP 삽질기2016. 3. 17. 00:56

[ C++ Lambda 함수 설명 ]

https://msdn.microsoft.com/ko-kr/library/dd293608.aspx

https://msdn.microsoft.com/ko-kr/library/dd293599.aspx

http://en.cppreference.com/w/cpp/language/lambda


'Coding > CPP 삽질기' 카테고리의 다른 글

C++ 컴파일러  (0) 2016.03.30
Lambda function  (0) 2016.03.16
짝수만 출력하기  (0) 2016.03.03
Posted by chobocho
Coding/CPP 삽질기2016. 3. 16. 01:02

#include <iostream>

using namespace std;


int main()

{

   int num = 2;

  

   auto sum = [](int n) -> int{ return n*n; }(num);

   

   cout << num << " " << sum << endl;

   

   return 0;

}



2 4


'Coding > CPP 삽질기' 카테고리의 다른 글

Lambda function  (1) 2016.03.17
짝수만 출력하기  (0) 2016.03.03
Couple  (0) 2015.12.23
Posted by chobocho
Coding/CPP 삽질기2016. 3. 3. 00:04

#include <iostream>

using namespace std;


int main()

{

    for (int i = 0; i < 100; i++) {

       i % 2 ||  cout << i << endl;   

    }

    return 0;

}




'Coding > CPP 삽질기' 카테고리의 다른 글

Lambda function  (0) 2016.03.16
Couple  (0) 2015.12.23
사각형 개수 구하기  (0) 2014.11.12
Posted by chobocho
Coding/CPP 삽질기2015. 12. 23. 00:42

#include <stdio.h>

#include <stdlib.h>


#define FALSE 0

#define TRUE  1



int IsSheBeautiful() { return (rand() % 101 > 99); }

int IsSheLikeMe()    { return (rand() % 51  > 49); }


int MeetGirl(int count) {

    int amIcouple = FALSE;

    

    // printf ("%d : I meet a girl!\n", count);

    

    if ( IsSheBeautiful() && IsSheLikeMe() ) {

        amIcouple = TRUE;

    }

    

    return amIcouple;

}


int Process() {

    int amIcouple = FALSE;

    int count = 0;

    

    while ( amIcouple == FALSE ) {

        amIcouple = MeetGirl(++count);      

    }

    printf ("I met %d girls\n", count);

    return amIcouple; 

}


int main(int argc, char **argv) {

    printf("%s\n", Process() == TRUE ? "I am not a single!" : "I am a sigle");

    return 0;

}


'Coding > CPP 삽질기' 카테고리의 다른 글

짝수만 출력하기  (0) 2016.03.03
사각형 개수 구하기  (0) 2014.11.12
Mirror  (0) 2014.10.27
Posted by chobocho
Coding/Tip2015. 8. 28. 01:53


Web 에서 Trello login -> 프린트할 카드 선택 -> Share and more ...  -> Print 선택


Posted by chobocho
Coding/Scala2014. 12. 3. 01:16

1. 1 부터 100까지 함

scala> (1 to 100).sum

res3: Int = 5050


2. 구구단 출력 하기

Hi-iMac:Scala chobocho$ cat mulitiplicaiton.scala

for ( x <- ( 1 to 9 )) {

    for ( y <- ( 1 to 9)) {

        println (x + " x " + y + " = " + x*y)

    }

}


3. 파일 열어서 출력하기

Hi-iMac:Scala chobocho$ cat openfile.scala

import scala.io.Source


val openFileName = "sample.scala"


for ( line <- Source.fromFile(openFileName).getLines() ) {

    println(line)

}


4. 파일의 글자 수 세기


5. 파일의 단어 수 세기

 

6. 가장 많이 나오는 알파벳 출력


7. 100! 계산하기

scala> (BigInt(1) to BigInt(100)).reduceLeft(_*_)

res8: BigInt = 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000


8. 2^100 계산하기

scala> BigInt(2).pow(100)

res1: scala.math.BigInt = 1267650600228229401496703205376


9. 2차원 배열에서 가장 큰 값 구하기


10. 선택정렬


11. 퀵 정렬



'Coding > Scala' 카테고리의 다른 글

스칼라 설치  (0) 2014.12.02
Posted by chobocho
Coding/Scala2014. 12. 2. 02:20
1. Download 
http://www.scala-lang.org

2. 환경설정





'Coding > Scala' 카테고리의 다른 글

Scala 프로그램밍 예제 100제  (2) 2014.12.03
Posted by chobocho