aboutsummaryrefslogtreecommitdiff
path: root/week01/Exercise4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'week01/Exercise4.cpp')
-rw-r--r--week01/Exercise4.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/week01/Exercise4.cpp b/week01/Exercise4.cpp
index 93c8eb9..29a231e 100644
--- a/week01/Exercise4.cpp
+++ b/week01/Exercise4.cpp
@@ -12,6 +12,10 @@ struct Flight {
float flightPrice;
};
+/*
+ * Подточка а)
+ */
+
void sortByTakeoff(Flight* flights, int N) {
for (int i = 0; i < N-1; i++) {
for (int j = 0; j < N-1 - i; j++) {
@@ -24,11 +28,8 @@ void sortByTakeoff(Flight* flights, int N) {
}
}
-/*
- * Подточка а)
- */
-
void A(Flight* flights, int N) {
+ sortByTakeoff(flights, N);
for (int i = 0; i < N; i++) {
std::cout << flights[i].takeoffCity << " " << flights[i].landingCity << " " << flights[i].flightPrice << std::endl;
}
@@ -257,7 +258,6 @@ int main() {
>> flights[i].landingTime
>> flights[i].flightPrice;
}
- sortByTakeoff(flights, N);
char cityToTakeoff[1024];
char cityToLand[1024];