-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbai21.cpp
More file actions
49 lines (45 loc) · 935 Bytes
/
bai21.cpp
File metadata and controls
49 lines (45 loc) · 935 Bytes
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
41
42
43
44
45
46
47
48
49
#include <iostream>
using namespace std;
void getPoint(float point[][2], int n)
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 2; j++)
{
cin >> point[i][j];
}
}
}
void printArray(float point[][2], int n)
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < 2; j++)
{
cout << point[i][j] << " ";
}
cout << endl;
}
}
string check(float point[][2], int n)
{
for (int i = 0; i < n; i++)
{
if (point[i][0] > 10 || point[i][0] < 0)
return "Sai diem so";
else if ( point[i][1] == 1 || point[i][1] == 1.5
|| point[i][1] == 2 || point[i][1] == 2.5
|| point[i][1] == 3)
continue;
}
return "";
}
int main()
{
int n;
cin >> n;
float point[100][2];
getPoint(point, n);
cout << check(point, n);
// printArray(point, n);
}