1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <stdlib.h> // предоставляет rand() и srand()
#include <time.h> // предоставляет time()
// число строк в массиве:
#define M 5
// длина каждой строки:
#define N 7
int main ()
{
srand(time(NULL)); // новая точка отсчета рнд
int B[M][N]; // массив
int cnt; // число отрицательных
int i, j;
// заполняем массив случайными:
for (i=0; i<M; i++)
for (j=0; j<N; j++)
B[i][j] = rand() %21 - 10;
// считаем отрицательные:
for (i=0; i<N; i++)
cnt = 0; // перед каждым новым столбцом сбрасываем счетчик отрицательных
for (j=0; j<M; j++)
if (B[i][j] < 0) cnt++;
printf("column #%i, count is: %d\n", i, cnt);
}
return 0; // конец программы
1) When I meet my friends, we usually talk about playing games.
2) I never forget to thank my parents for giving me pocket money.
3) I've been thinking of bying a new phone for a rather long time.
4) I've never dreamt of going to China in my life.
5) My sister often complains of being ignored.
6) Once I tried to stop my friend from eating too much pizza.
7) I don't often complain of studying at my school.
8) Nobody can keep me from listening to my favourite music.
9) I'll never forget how once I had to apologize for breaking a plate in the school canteen.
10) Only hurricane can keep me from leaving home.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <stdio.h>
#include <stdlib.h> // предоставляет rand() и srand()
#include <time.h> // предоставляет time()
// число строк в массиве:
#define M 5
// длина каждой строки:
#define N 7
int main ()
{
srand(time(NULL)); // новая точка отсчета рнд
int B[M][N]; // массив
int cnt; // число отрицательных
int i, j;
// заполняем массив случайными:
for (i=0; i<M; i++)
for (j=0; j<N; j++)
B[i][j] = rand() %21 - 10;
// считаем отрицательные:
for (i=0; i<N; i++)
{
cnt = 0; // перед каждым новым столбцом сбрасываем счетчик отрицательных
for (j=0; j<M; j++)
if (B[i][j] < 0) cnt++;
printf("column #%i, count is: %d\n", i, cnt);
}
return 0; // конец программы
1) When I meet my friends, we usually talk about playing games.
2) I never forget to thank my parents for giving me pocket money.
3) I've been thinking of bying a new phone for a rather long time.
4) I've never dreamt of going to China in my life.
5) My sister often complains of being ignored.
6) Once I tried to stop my friend from eating too much pizza.
7) I don't often complain of studying at my school.
8) Nobody can keep me from listening to my favourite music.
9) I'll never forget how once I had to apologize for breaking a plate in the school canteen.
10) Only hurricane can keep me from leaving home.