Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- aaaaaaa
- aaaaaab
- aaaaaac
- .
- .
- .
- zzzzzzx
- zzzzzzy
- zzzzzzz
- for(i = 0; i<length; i++){
- pass[i] = 'a';
- }
- while(1){
- for(j=0;j<26;j++){
- printf("%sn",pass);
- pass[i] = (char)(pass[i]+1);
- }
- if(pass[i-1]==z)...
- }
- return 0;
- #include <stdio.h>
- #include <string.h>
- void iterate(char *str, int idx, int len) {
- char c;
- if (idx < (len - 1)) {
- for (c = 'a'; c <= 'z'; ++c) {
- str[idx] = c;
- iterate(str, idx + 1, len);
- }
- } else {
- for (c = 'a'; c <= 'z'; ++c) {
- str[idx] = c;
- printf("%sn", str);
- }
- }
- }
- #define LEN 3
- int main(int argc, char **argv) {
- char str[LEN + 1];
- memset(str, 0, LEN + 1);
- iterate(str, 0, LEN);
- }
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int isFinish(char *str){
- return '