請幫我把以下的程式加上註解,謝謝!
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MAX 20
static char a[MAX];
static int co;
void gen(int n){
n++;
char tmp;
for(int i=n;i<co;i++){
tmp=a[n];
a[n]=a[i];
a[i]=tmp;
if(n==co-1)
printf("%s\n",a);
else
gen(n);
tmp=a[n];
a[n]=a[i];
a[i]=tmp;
}
}
int main(){
printf("請輸入a,b,c,d,e:\n");
scanf("%s",a);
co=strlen(a);
gen(-1);
system("pause");
return 0;
}
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends: 'You Say What You Like, Because They Like What You Say' - http://www.medialens.org/index.php/alerts/alert-archive/alerts-2013/731-you-say-what-you-like-because-they-like-what-you-say.html