Ответы
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#define CELLS 10
#define COLS 50
int main(void) {
srand(time(NULL)); /* for "visible" random */
int array[COLS][CELLS];
int i;
int j;
for (i = 0; i < COLS; i++) {
for (j = 0; j < CELLS; j++) {
array[i][j] = 1 + rand() % 10 - 1; /* random 1 through 9 */
printf("%d ", array[i][j]);
}
printf("n");
}
getch();
printf("n");
int valid = 0;
for (i = 0; i < COLS; i++) {
int max = 0;
printf("sum of [");
for (j = 0; j < CELLS; j++) {
if (j < (CELLS - 1)) {
printf("%d ", array[i][j]);
} else {
printf("%d] = ", array[i][j]);
}
max += array[i][j];
}
printf("%d ", max);
if (max % 7 == 0) {
valid++;
printf("[%d / 7 = %d]n", max, max / 7);
} else {
printf("n");
}
}
printf("namount: %dn", valid);
getch();
return 0;
}