/* pwsearcher.c 小文字のアルファベットだけから成る6文字語を全て書き出すプログラム */ #include #include main() { int i, j, k, l, m, n; char s[] = "aaaaaa"; clock_t t0, t1; t0 = clock(); for(i = 0; i < 26; i++){ s[0] = 97 + i; //printf("%s\n", s); for(j = 0; j < 26; j++){ s[1] = 97 + j; // printf("%s\n", s); for(k = 0; k < 26; k++){ s[2] = 97 + k; printf("%s\n", s); for(l = 0; l < 26; l++){ s[3] = 97 + l; // printf("%s\n", s); for(m = 0; m < 26; m++){ s[4] = 97 + m; // printf("%s\n", s); for(n = 0; n < 26; n++){ s[5] = 97 + n; //printf("%s\n", s); } } } } } } t1 = clock(); printf("所要時間 %f秒\n",(double)(t1 - t0)/CLOCKS_PER_SEC); }