코드카타-소수 만들기

#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
bool isPrime(int x) {
if (x < 2 )
{
return false;
}
for (int d = 2; d*d <= x; d++ )
{
if(x % d == 0)
{
return false;
}
}
return true;
}
int solution(vector<int> nums) {
int answer = 0;
int n = (int)nums.size();
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
for (int k = j + 1; k < n; k++) {
int sum = nums[i] + nums[j] + nums[k];
if (isPrime(sum)) {
answer++;
}
}
}
}
return answer;
}
팀 프로젝트 진행도
MineItem의 헤더와 cpp파일을 응용하여 Ghost를 만들었는데 문제는, 에셋이 게임 실행 화면에 안 보인다.
내일 그 문제를 찾아봐야 한다.
'TIL' 카테고리의 다른 글
| 3/04일자 TIL (0) | 2026.03.04 |
|---|---|
| 3/03일자 TIL (0) | 2026.03.03 |
| 2/26일자 TIL (0) | 2026.02.26 |
| 2/25일자 TIL (0) | 2026.02.25 |
| 2/24일자 TIL (0) | 2026.02.24 |