#include <iostream> #include <vector> using namespace std; int vis[1000000][100]={1}; int main() { -vector<int> x={5,2,1}; -int y = 10; -for(int j=1; j<=x.size() ; j++) --for(int i=0; i<=y; i++) ---if(i < x[j-1]) ----vis[i][j] = vis[i][j-1]; ---else ----vis[i][j] = vis[i][j-1] + vis[i-x[j-1]][j]; -cout<< vis[y][x.size()] <<endl; }
. A program that calculates the power using (a base number and an exponent)