Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- main() {
- int mas[12], a, b, c, i;
- scanf("%d %d", &a, &b);
- for (i = 0; i < 12; i++) {
- srand(clock()+i);
- c = rand() % (b - a + 1);
- mas[i] = c + a;
- }
- printf("--------------------------------\n");
- printf("index: ");
- for (i = 0; i < 6; i++) {
- printf ("\t%3d", i+1);
- }
- printf("\n");
- printf("element:");
- for (i = 0; i < 6; i++) {
- printf ("\t%3d", mas[i]);
- }
- printf("\n--------------------------------\n");
- printf("index: ");
- for (i = 6; i < 12; i++) {
- printf ("\t%3d", i+1);
- }
- printf("\n");
- printf("element:");
- for (i = 6; i < 12; i++) {
- printf ("\t%3d", mas[i]);
- }
- printf("\n--------------------------------\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement