#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 |
#define DEBUG
#ifdef DEBUG
#define cprintf(...) printf(__VA_ARGS__)
#else
#define cprintf(...)
#endif
가장 넓은 직사각형 구하는 알고리즘 ( O(MN) ) (0) | 2016.04.13 |
---|---|
C++ 컴파일러 (0) | 2016.03.30 |
Lambda function (1) | 2016.03.17 |
무료 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 )
너무 유명하므로 설명은 생략 합니다.
printf로 디버깅 하기 (0) | 2016.04.13 |
---|---|
Lambda function (1) | 2016.03.17 |
Lambda function (0) | 2016.03.16 |
심심해서 다시 만들어 보는 테트리스
Android studio 디바이스 연결 (0) | 2016.08.20 |
---|---|
1. 온라인 테트리스 만들기 ( 이클립스 설치 ) (1) | 2014.01.03 |
초간단 보이스 레코더 (0) | 2013.03.08 |
[ 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
C++ 컴파일러 (0) | 2016.03.30 |
---|---|
Lambda function (0) | 2016.03.16 |
짝수만 출력하기 (0) | 2016.03.03 |
#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
Lambda function (1) | 2016.03.17 |
---|---|
짝수만 출력하기 (0) | 2016.03.03 |
Couple (0) | 2015.12.23 |
#include <iostream>
using namespace std;
int main()
{
for (int i = 0; i < 100; i++) {
i % 2 || cout << i << endl;
}
return 0;
}
Lambda function (0) | 2016.03.16 |
---|---|
Couple (0) | 2015.12.23 |
사각형 개수 구하기 (0) | 2014.11.12 |
#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;
}
짝수만 출력하기 (0) | 2016.03.03 |
---|---|
사각형 개수 구하기 (0) | 2014.11.12 |
Mirror (0) | 2014.10.27 |
Web 에서 Trello login -> 프린트할 카드 선택 -> Share and more ... -> Print 선택
삼성 노트북 삼성 TV와 무선 연결 하기 (0) | 2017.05.03 |
---|---|
[Mac] Screen shot 을 Drop box 에 저장되게 하기 (0) | 2014.11.29 |
Sinppely ( Code snippet tool ) (0) | 2013.05.19 |
scala> (1 to 100).sum
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. 퀵 정렬
2. 환경설정
Scala 프로그램밍 예제 100제 (2) | 2014.12.03 |
---|