목록전체 글 (159)
할껀하고놀자
#include using namespace std; int main() { int n; cin >> n; n = 1000 - n; int result = 0; result += n / 500; n %= 500; result += n / 100; n %= 100; result += n / 50; n %= 50; result += n / 10; n %= 10; result += n / 5; n %= 5; result += n / 1; cout
#include using namespace std; int main() { int n, result = 0; cin >> n; result += n / 500; n %= 500; result += n / 100; n %= 100; result += n / 50; n %= 50; result += n / 10; n %= 10; cout
#include #include #include using namespace std; const int n = 7; const int m = 11; int getParent(int parent[], int x) { if (x == parent[x]) return x; return parent[x] = getParent(parent, parent[x]); } void unionParent(int parent[], int a, int b) { a = getParent(parent, a); b = getParent(parent, b); if (a < b)parent[b] = a; else parent[a] = b; } int find(int parent[], int a, int b) { a = getParen..