Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int last;
- int rand1(int t)
- {
- int z = rand() % t;
- while(z == last)
- z = rand() % t;
- last = z;
- return z;
- }
- int main()
- {
- srand(time(NULL));
- int j, i, t;
- for(j = 0; j < 20; ++j)
- {
- t = 5 + rand1(10);
- printf("М");
- if (rand1(2) == 1)
- printf("а");
- else
- printf("у");
- if (rand1(2) == 1)
- printf("рг");
- else
- printf("гр");
- printf("а");
- for(i = 0; i < t; ++i)
- {
- switch(rand1(4))
- {
- case 0:
- printf("р");
- break;
- case 1:
- printf("гу");
- break;
- case 2:
- printf("ла");
- break;
- case 3:
- printf("го");
- break;
- }
- }
- printf("л\n");
- }
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment