如何用C++暴力算法解决硬币分配机器谜题?期末项目求助
求助完善C++暴力算法代码(便士分配机问题)
这是我的期末项目,截止日期只剩几天,我正尝试用C++暴力算法解决便士分配机问题。以下是我写的未完成代码,请求帮忙完善:
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; int x; cout << "enter the amount of coins" << endl; cin >> n; cout << "Enter size of array:" << endl; cin >> x; int* a = new int(x); a [0] = n; for (int i = 1; i < x; i++) { a[i] = 0;
内容的提问来源于stack exchange,提问作者user19794843
相关产品推荐
相关产品推荐

