-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (24 loc) · 838 Bytes
/
main.cpp
File metadata and controls
28 lines (24 loc) · 838 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
/* --------------------------------------------------------------- */
// You do not need to touch this
/* --------------------------------------------------------------- */
#include "logic.hpp"
int main(int argc, char** argv) {
if( argc < 3 ) {
std::cout << "Usage: " << argv[0] << " <retries> <array_size>" << std::endl;
return 0;
}
const int RETRIES = atoi(argv[1]);
const int ARR_SIZE = atoi(argv[2]);
if( RETRIES == 0 || ARR_SIZE == 0 ) {
std::cout << "Both retries and array_size should be valid positive numbers" << std::endl;
return 0;
}
Profiled p;
for( int i = 0 ; i < RETRIES; ++i ) {
Numbers array = get_array(ARR_SIZE);
double avg = get_avg(array);
if( !check_avg(array, avg) ) {
break;
}
}
}