@slava_g1
72 / 72 / 8
Регистрация: 06.02.2011
Сообщений: 127
|
17.06.2011, 00:12
|
|
C++ | 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
| #include<iostream>
#include<ctime>
using namespace std;
void main(){
srand(time(0));
int index=0;
const int MAX=5;
int arr[MAX][MAX];
for(int i=0;i<MAX;i++){
for(int j=0;j<MAX;j++){
arr[i][j]=(rand()%10)-2;
cout<<arr[i][j]<<"\t";
}
cout<<endl;
}
for(int i=0;i<MAX;i++){
int count = 0;
for(int j=0;j<MAX;j++){
if(arr[i][j]>=0)
count++;
}
if(count==MAX){
index=i;
i=MAX;
}
}
cout<<"Row number : "<<index<<endl;
} |
|
Спасибо ниже.
0
|