#include <stdio.h>int main (){int a,b,c,sum;int num=0;for (a=1;a<5;a++){for (b=1;b<5;b++){for (c=1;c<5;c++){if (a!=b && a!=c && b!=c){printf("%d\n",sum);num++;}}}}printf("yi gong you %d ge shu \n",num);return 0;}...【阅读全文】
M={r1, r2, r3.......rn}对M进行全排列,并输出。M中元素可能有重复。#include<stdlib.h>void swap(int *a, int *b){ int tmp; tmp = *a; *a = *b; *b = tmp;}int total = 0;void perm(int list[], int k, int n){ int i; &nb...【阅读全文】