void getCombine(vector<vector<int>>& returnColumn,vector<int>& tmp,int step,int n,int k){ if(step==k){ vector<int> res(tmp); returnColumn.push_back(res); return; } for(int i=step==0?1:tmp[step-1]+1;i<=n;i++){ tmp[step]=i; getCombine(returnColumn,tmp,step+1,n,k); } }
static void printMasmHeader( section_ptr sec ) { orl_sec_alignment alignment; orl_sec_flags flags; orl_sec_type type; orl_sec_frame frame; orl_sec_combine combine; orl_sec_size size; char *name; char *class; char *gname; char *astr; orl_sec_handle sh; orl_group_handle grp = NULL; char comname[ MAX_LINE_LEN ]; size = ORLSecGetSize( sec->shnd ); // Load all necessary information name = sec->name; if( !name ) { name = ""; } type = ORLSecGetType( sec->shnd ); flags = ORLSecGetFlags( sec->shnd ); frame = ORLSecGetAbsFrame( sec->shnd ); if( DFormat & DFF_ASM ) { class = ORLSecGetClassName( sec->shnd ); if( !class ) { class = ""; } if( flags & ORL_SEC_FLAG_COMDAT ) { BufferConcat( "; ERROR: Comdat symbols cannot be assembled." ); } else if( frame == ORL_SEC_NO_ABS_FRAME ) { alignment = ORLSecGetAlignment( sec->shnd ); combine = ORLSecGetCombine( sec->shnd ); BufferQuoteName( name ); BufferStore( "\t\tSEGMENT\t%s %s %s '%s'", getAlignment( alignment ), getCombine( combine ), getUse( flags ), class ); } else {
vector<vector<int>> combine(int n, int k) { vector<vector<int>> returnColumn; vector<int> tmp(k); getCombine(returnColumn,tmp,0,n,k); return returnColumn; }