목록분류 전체보기 (135)
게임 개발 메모장
#include #include #include using namespace std; int main() { int n,m; cin >> n; vector A(n); for (int i = 0; i > A[i]; } sort(A.begin(), A.end()); cin >> m; vector B(m); vector C(n + m); for (int i = 0; i > B[i]; } sort(B.begin(), B.end()); int Pos1 = 0; int Pos2 = 0; int Pos3 = 0; int Count = n; if (Count < m) { Count = m; } for (int i = 0; i < Count; ++i) { if..
#include #include using namespace std; int main() { int n,m; cin >> n; vector vecA(n); for (int i = 0; i > vecA[i]; } cin >> m; vector vecB(m); for (int i = 0; i > vecB[i]; } vector vecC(m + n); int PosA = 0; int PosB = 0; int PosC = 0; bool IsLongestA = false; int Count = m; if (n > m) { IsLongestA = true; Count = n; } for (int i = 0; i < Count; ++i) { if (vecA..
#include #include using namespace std; int main() { int n; cin >> n; vector vec(n); for (int i = 0; i > vec[i]; } int i, j, tmp = 0; for (i = 1; i = 0; --j) { if (tmp < vec[j]) { vec[j + 1] = vec[j]; } else { break; } } vec[j + 1] = tmp; } for (int i = 0; i < n; ++i) { cout
#include #include using namespace std; int main() { int n; cin >> n; vector vec(n); for (int i = 0; i > vec[i]; } // 뒤에서 부터 채워 나간다. for (int i = 0; i 0 && vec[j + 1] < 0) { int Temp = vec[j]; vec[j] = vec[j+1]; vec[j+1] = Temp; } } } for (int i = 0; i < n; ++i) { cout
#include #include using namespace std; int main() { int n; cin >> n; vector vec(n); for (int i = 0; i > vec[i]; } // 뒤에서 부터 채워 나간다. for (int i = 0; i vec[j + 1]) { int Temp = vec[j]; vec[j] = vec[j+1]; vec[j+1] = Temp; } } } for (int i = 0; i < n; ++i) { cout
#include #include using namespace std; int main() { int n; cin >> n; vector Vec(n); for (int i = 0; i > Vec[i]; } int MaxIndex = 0; int Temp = 0; for (int i = 0; i < n - 1; ++i) { MaxIndex = i; for (int j = i + 1; j < n; ++j) { if (Vec[MaxIndex] < Vec[j]) { MaxIndex = j; } } Temp = Vec[MaxIndex]; Vec[MaxIndex] = Vec[i]; Vec[i] = Temp; } int Count = 0; int PreValue = 0; for (int ..
#include #include using namespace std; int main() { int n,m; cin >> n; vector Vec(n); for (int i = 0; i > m; Vec[i] = m; } int MinIdx = 0; for (int i = 0; i Vec[j]) { MinIdx = j; } } int Temp = 0; Temp = Vec[i]; Vec[i] = Vec[MinIdx]; Vec[MinIdx] = Temp; } for (int i = 0; i < n; ++i) { cout