#include<iostream>using namespace std;int *arr;int n;void print(){ cout << n << " = " << arr[0]; int i = 1; while(arr[i]) cout << " + " << arr[i++]; cout << endl;}void process(int arr[], int max, int n)//n为剩余值,max为当前位置可以为最大的数。{ arr[0] = max < n ? max : n; if(n == 0) ...
#include<iostream>using namespace std;void printchar(int n, char ch){ for(int i = 0; i != n; ++i) cout << ch;}void fun(int i, int j, int n){ printchar(i,' '); printchar(j,'*'); cout << endl; if(j<n) { fun(i-1,j+2,n); printchar(i,' '); printchar(j,'*')...
/* Standard error macro for reporting API errors */ #define PERR(bSuccess, api){if(!(bSuccess)) printf("%s:Error %d from %s \ on line %d\n", __FILE__, GetLastError(), api, __LINE__);}void cls( HANDLE hConsole ){ COORD coordScreen = { 0, 0 }; /* here's where we'll home the ...
#include<iostream>using namespace std;void print(const int A[], const int B[], int Bn){ for (int i = 0; i != Bn; ++i) cout << A[*(B+i)];}bool fun(int B[], int Bn, int An)//处理进位{ int x = Bn-1; while(B[x] > x+An-Bn) { if(x == 0) return false; B[x-1] += 1; --x...