milardovich

Permutations draft

Sep 6th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. char name[7],buffer[7];
  5.  
  6. void permute(char s[7]);
  7. void main(){
  8.     strcpy(name,"qwe");
  9.     permute(name);
  10. }
  11. void permute(char s[7]){
  12.     int i,k;
  13.     char aux,buffer[7];
  14.     for(i=0;i<strlen(s);i++){
  15.         for(k=0;k<strlen(s);k++){
  16.             if(i != k){
  17.                 printf("%c <--> %c \n",s[i],s[k]);
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment