2013年9月2日

摘要: // 40、用1、2、2、3、4、5这六个数字,写一个main函数,打印出所有不同的排列,// 如:512234、412345等,要求:"4"不能在第三位,"3"与"5"不能相连.void permutation(int a[],int i,int n,int pre)// 我们保留前一个位置的值{ if(i==n-1) { // 验证是否合格 for(int k=0;k<n;k++) { if(k==2&&a[k]==4) { cout<<"error"<<endl; 阅读全文
posted @ 2013-09-02 20:04 dyc0113 阅读(308) 评论(0) 推荐(0) 编辑

导航