#include "stdio.h" #include "string.h" #include "time.h" #include "stdlib.h"
void swap(char*, char*); void main() { char *Race="abcdefghijklmnopqrstuvwxyz"; int i,j,k; char *Ptr; Ptr=Race;
srand(time(NULL)); i=1+rand()%10 ; printf("%d\n",i); k=0; if(i<=5) k+=3; if(i>=6) k+=4;
swap(&Race[1],&Race[k]);
for(j=0;j<26;j++) { printf("%c",Race[j]); }
}
void swap(char* Ptr1,char* Ptr2) { char temp; temp=*Ptr1; *Ptr1=*Ptr2; *Ptr2=temp; } 
|