-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinal_result.c
More file actions
34 lines (29 loc) · 891 Bytes
/
Copy pathfinal_result.c
File metadata and controls
34 lines (29 loc) · 891 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
#include <stdio.h>
#include "index_first_negative.h"
#include "index_last_negative.h"
#include "multi_between_negative.h"
#include "multi_before_and_after_negative.h"
#include "console_input_opt.h"
#include "console_input_arr.h"
#include "final_result.h"
#define ARR_MAX_SIZE 20
int final_result(int case_num, int arr1[], int length){
switch(case_num){
case 0:
printf("%d\n", index_first_negative(arr1, length));
break;
case 1:
printf("%d\n", index_last_negative(arr1, length));
break;
case 2:
printf("%d\n", multi_between_negative(arr1, length));
break;
case 3:
printf("%d\n", multi_before_and_after_negative(arr1, length));
break;
default:
printf("Данные некорректны");
break;
}
return 0;
}