일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 영알남
- Project
- Euler
- CSS
- 연결리스트
- if
- 파이선
- Bull
- UE4
- cout
- 알고리즘
- std
- html
- for
- dictation
- 파이썬
- Notting hill
- Unreal
- 코딩도장
- Java
- unreal engine4
- cow
- Polymorphism
- bool
- C++
- font weight
- html5
- endl
- codecademy
- python
- Today
- Total
목록C++ (12)
/* 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 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 ..
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
세 자연수 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
1 ~ 10 사이의 어떤 수로도 나누어 떨어지는 가장 작은 수는 2520입니다. 그러면 1 ~ 20 사이의 어떤 수로도 나누어 떨어지는 가장 작은 수는 얼마입니까? #include int main() { int cuVal=20; int toVal; bool getVal = true; while (getVal) { for (int i = 1; i
어떤 수를 소수의 곱으로만 나타내는 것을 소인수분해라 하고, 이 소수들을 그 수의 소인수라고 합니다. 예를 들면 13195의 소인수는 5, 7, 13, 29 입니다. 600851475143의 소인수 중에서 가장 큰 수를 구하세요. #include int main() { long long val = 600851475143; bool status = true; while (status) { for (int i = 2; i
코어 데이터 유형정수형정수 데이터 유형의 규칙은 "int" 나 "unit" 뒤에 크기를 비트 단위로 붙이는 것입니다.변수 유형설명uint88-bit unsigneduint1616-bit unsigneduint3232-bit unsigneduint6464-bit unsignedint88-bit signedint1616-bit signedint3232-bit signedint6464-bit signed부동 소수점 유형언리얼은 표준 C++ 부동 소수점 유형인 float 와 double 을 사용합니다.불리언 유형불리언 유형은 C++ bool 키워드 또는 비트 필드로 나타낼 수 있습니다.uint32 bIsHungry : 1; bool bIsThirsty;스트링언리얼은 세 가지 핵심 유형의 스트링을 지원합니다.FS..
Queue.h 파일 #includeusing namespace std; class Node {Node* link;int data;public:Node(int val = 0) :data(val), link(NULL) {}Node* getLink() { return link; }void setLink(Node* next) { link = next; }void display() { cout setLink(p);rear = p;}} Node* dequeue() {if (isEmpty()) return NULL;Node* p = front;front = front->getLink();if (front == NULL)rear = NULL;return p;} Node* peek() { return front; }vo..