일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Notting hill
- cow
- if
- 연결리스트
- Bull
- CSS
- dictation
- html
- endl
- 파이선
- codecademy
- 코딩도장
- C++
- unreal engine4
- font weight
- cout
- python
- Java
- 영알남
- UE4
- std
- Project
- html5
- Euler
- 알고리즘
- bool
- Unreal
- Polymorphism
- for
- 파이썬
- Today
- Total
목록Programming (67)
/* This is the console executable, that makes use of the BullCow classThis acts as the view in a MVC pattern, and is responsible for alluser interaction. For game logic see the FBullCowGame class.*/#pragma once#include #include #include "FBullCowGame.h" using FText = std::string;using int32 = int; void PrintIntro();void PlayGame();void PrintGameSummary();FText GetValidGuess();bool AskToPlayAgain..
#pragma once#include "FBullCowGame.h"#include #define TMap std::map using int32 = int; FBullCowGame::FBullCowGame() { Reset(); } int32 FBullCowGame::GetCurrentTry() const { return MyCurrentTry; }int32 FBullCowGame::GetHiddenWordLength() const{return MyHiddenWord.length();}bool FBullCowGame::IsGameWon() const{return bGameIsWon;} int32 FBullCowGame::GetMaxTries() const { TMap WordLengthToMaxTries{..
#pragma once#include using FString = std::string;using int32 = int; struct FBullCowCount {int32 Bulls = 0;int32 Cows = 0;}; enum class EWordStatus {Invalid_Status,OK,Not_Isogram,Wrong_Length,Not_Lowercase}; class FBullCowGame {public:FBullCowGame(); // constructor int32 GetMaxTries() const;int32 GetCurrentTry() const;int32 GetHiddenWordLength() const;bool IsGameWon() const;void Reset(); // TODO ..
콜리전 반응과 충돌이벤트 콜리전이 겹칠때 반응은 Block(막음), Overlap(통과), Ignore(무시) 가 있다. Block은 벽에 부딪치는 공과 같이 공이 지나가지 못하도록 벽이 가로막는 상태이며, Overlap은 총알이 사과와 충돌하는 경우 총알이 사과를 뚫고 지나가도록 통과를 허용하는 상태이다. 콜리전의 반응을 무시로 설정하면 충돌 이벤트가 발생하지 않는다. *종류 Block+Block Hit이벤트 Block+Overlap Overlap이벤트 Overlap+Overlap Overlap이벤트 Block+Ignore 이벤트 없음 Overlap+Ignore 이벤트 없음 --->충돌을 하려면 양쪽 모두 Simulation Generates Hit Events 나 Generate Overlap Eve..
1부터 n까지의 자연수를 차례로 더하여 구해진 값을 삼각수라고 합니다. 예를 들어 7번째 삼각수는 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28이 됩니다. 이런 식으로 삼각수를 구해 나가면 다음과 같습니다. 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... 이 삼각수들의 약수를 구해봅시다. 1: 1 3: 1, 3 6: 1, 2, 3, 6 10: 1, 2, 5, 10 15: 1, 3, 5, 15 21: 1, 3, 7, 21 28: 1, 2, 4, 7, 14, 28 위에서 보듯이, 5개 이상의 약수를 갖는 첫번째 삼각수는 28입니다. 그러면 500개 이상의 약수를 갖는 가장 작은 삼각수는 얼마입니까? #include int main() { long a; // 삼각수 int n..
10 이하의 소수를 모두 더하면 2 + 3 + 5 + 7 = 17 이 됩니다. 이백만(2,000,000) 이하 소수의 합은 얼마입니까? #include int main() { long long sum = 0; long long num = 1; bool yey = true; while (yey) { num++; for (int i = 2; i = 100000) yey = false; } std::cout
#include "Engineminimal.h"or#include "CoreMinimal.h" #include "Engine.h" 위에 두 개 중 하나를 밑에 껄로 바꿔주면 인식이 된다!
세 자연수 a, b, c 가 피타고라스 정리 a2 + b2 = c2 를 만족하면 피타고라스 수라고 부릅니다 (여기서 a < b < c ). 예를 들면 32 + 42 = 9 + 16 = 25 = 52이므로 3, 4, 5는 피타고라스 수입니다. a + b + c = 1000 인 피타고라스 수 a, b, c는 한 가지 뿐입니다. 이 때, a × b × c 는 얼마입니까? #include int main() { int a, b; bool gow = true; for (int i=1; i < 1000; i++) { for (int j=1; j < 1000; j++) { if ((1000 - (j + i))*(1000 - (j + i)) + (j*j) == i*i) { a = j; b = i; gow = false..
소수를 크기 순으로 나열하면 2, 3, 5, 7, 11, 13, ... 과 같이 됩니다. 이 때 10,001번째의 소수를 구하세요. #include int main() { int count = 0; int number = 2; while (count < 10001) { for (int i = 2; i
1부터 10까지 자연수를 각각 제곱해 더하면 다음과 같습니다 (제곱의 합). 12 + 22 + ... + 102 = 385 1부터 10을 먼저 더한 다음에 그 결과를 제곱하면 다음과 같습니다 (합의 제곱). (1 + 2 + ... + 10)2 = 552 = 3025 따라서 1부터 10까지 자연수에 대해 "합의 제곱"과 "제곱의 합" 의 차이는 3025 - 385 = 2640 이 됩니다. 그러면 1부터 100까지 자연수에 대해 "합의 제곱"과 "제곱의 합"의 차이는 얼마입니까? #include int main() { int sum = 0; int sum2 = 0; for (int i = 1; i