프로그래밍(301)
-
비주얼 스튜디오에서 가비지 값은 왜 같은가?
1. 서론게임 아카데미 동기들과 함께 야간 코딩을 하는 중 쓰레기값을 출력해보았다.int a[1000] 배열을 생성해서 1000개를 출력해봤는데 다 같은 값!왜 다 같은값인가? 2. 구글링검색어는 'why garbage value same' http://bytes.com/topic/c/answers/948937-why-garbage-value-same-all-variables여기에서 해당 문제에 대한 답변을 보았다. In the case of Visual Studio, the same garbage value is used for all variables. This is how the debugger can tell you that a variable you are using has not been in..
2015.02.15 -
Project Euler Problem10
Problem10The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.Find the sum of all the primes below two million. 나의 풀이)정말.. 수퍼 발코딩으로 풀었다.저번에 구현했던 isPrime 함수를 통해 소수를 찾고 2,000,000까지 반복문!isPrime에서 돌아가는 for문과 메인에서 돌아가는 for문을 합치니... 거의 O(n^2)급이니루프 200만번은 정말 가혹한 속도..15분만에 결과가 나왔는데.... 여튼 답은 구했다.. 외국 고수님들 풀이를 좀 읽어봐야겠다. 다른 사람의 풀이)continue ...
2015.02.15 -
Project Euler Problem9
Problem 9A Pythagorean triplet is a set of three natural numbers, a
2015.02.15 -
Project Euler Problem5
Problem5.2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? 나의 풀이)알고리즘은 소수의 최대제곱을 찾으면 되는 것이다.특히 2와 3의 값이 중요한데5부터는 어차피 2개 이상 가지고 있는 수는 25를 넘어가버리므로5,7,11,13,17,19는 확정으로 곱해진다.2의 배수 중 20이하의 수를 구하면 16 = 2^43의 배수 중 20이하의 수는 9 = 3^2 이므로 이를 모두 곱하면 답이 된다..
2015.02.12 -
[VS] Visual Studio 코드 라인 수 보기
코드 라인 수 설정을 해보자! 도구 > 옵션 > 텍스트편집기 > C/C++ > '줄 번호' 체크! 쉽죠?
2015.02.11 -
[하일라이팅] 소스코드 하일라이팅
여러 사이트가 있지만 여기가 맘에 든다. http://colorscripter.com 언어, 스타일패키지, 배경 등등 다양하게 조정할 수 있다.
2015.02.05