-
Notifications
You must be signed in to change notification settings - Fork 0
/
1509.cpp
40 lines (35 loc) · 953 Bytes
/
1509.cpp
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
33
34
35
36
37
38
39
40
#include <iostream>
using namespace std;
int main()
{
int a[10][10] = {};
int b[10] = {};
for(int i = 0; i < 10; i++)
for(int j = 0; j < 10; j++)
cin >> a[i][j];
for(int i = 0; i < 10; i++)
cin >> b[i];
for(int i = 0; i < 10; i++)
if(b[i] == 1)
for(int j = 9; j >= 0; j--)
{
if(a[j][i] == 0)
{
if(j == 0)
cout << i + 1 << " " << "safe" << endl;
else
continue;
}
else if(a[j][i] < 0)
{
cout << i + 1 << " " << "fall" << endl;
break;
}
else if(a[j][i] > 0)
{
cout << i + 1 << " " << "crash" << endl;
break;
}
}
return 0;
}