일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- for
- python
- C++
- 파이썬
- 파이선
- Notting hill
- Bull
- Unreal
- Euler
- html5
- 연결리스트
- 코딩도장
- Java
- dictation
- html
- CSS
- font weight
- codecademy
- cow
- 영알남
- if
- bool
- std
- UE4
- Project
- 알고리즘
- cout
- Polymorphism
- unreal engine4
- endl
- Today
- Total
목록cout (7)
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
앞에서부터 읽을 때나 뒤에서부터 읽을 때나 모양이 같은 수를 대칭수(palindrome)라고 부릅니다. 두 자리 수를 곱해 만들 수 있는 대칭수 중 가장 큰 수는 9009 (= 91 × 99) 입니다. 세 자리 수를 곱해 만들 수 있는 가장 큰 대칭수는 얼마입니까? #include int main() { int val = 0; for (int m=999;m>=100;m--) { for (int j = 999; j >= 100; j--) { int i = m*j; int a = i / 100000; int b = (i - a * 100000) / 10000; int c = (i - a * 100000 - b * 10000) / 1000; int d = (i - a * 100000 - b * 10000 - ..
Student.h 파일 #include #include#include#includeusing namespace std; const int MAX_STRING = 100; class Student {int id;char name[MAX_STRING];char dept[MAX_STRING];public:Student(int i = 0, char* n = "", char* d = ""){set(i, n, d);}void set(int i, char* n, char* d) {id = i;strcpy_s(name, n);strcpy_s(dept, d);}void display() {cout