Updated to initial implementation using cpp.
This commit is contained in:
23
Main.h
Normal file
23
Main.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <iostream>
|
||||
#include <chrono>
|
||||
#include "Exercises.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
while (true) {
|
||||
// Input
|
||||
char input;
|
||||
cout << "Check(c), test(t) or quit(q) -> ";
|
||||
cin >> input;
|
||||
cout << endl;
|
||||
|
||||
// action
|
||||
auto t1 = std::chrono::high_resolution_clock::now();
|
||||
if (input == 'c') cout << "check result: " << Ex3(13195) << endl;
|
||||
else if (input == 't') cout << "test result: " << Ex3(600851475143) << endl;
|
||||
else if (input == 'q') break;
|
||||
auto t2 = std::chrono::high_resolution_clock::now();
|
||||
auto duration_ns = std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count();
|
||||
cout << "Duration = " << duration_ns << " microseconds" << endl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user