Advertisement
Guest User

Untitled

a guest
Jun 21st, 2016
2,222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 KB | None | 0 0
  1. //Ez a program kiirja a kepernyore az "irogep" szot
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include <time.h>
  7.  
  8. int main(){
  9.     char szo[]="aaaaaa";
  10.    
  11.     srand(time(NULL));
  12.    
  13.     while(strcmp(szo,"irogep")){
  14.         szo[0]=97+rand()%26;
  15.         szo[1]=97+rand()%26;
  16.         szo[2]=97+rand()%26;
  17.         szo[3]=97+rand()%26;
  18.         szo[4]=97+rand()%26;
  19.         szo[5]=97+rand()%26;
  20.     }
  21.    
  22.     printf("%s\n",szo);
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement