-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollatz.h
More file actions
71 lines (59 loc) · 1.16 KB
/
Copy pathCollatz.h
File metadata and controls
71 lines (59 loc) · 1.16 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/**
* @header Collatz.h
* @version 1.0
* @date 07/17/2017
* @author Juan Trejo
* @title Collatz
* @brief Implementation of Collatz conjecture
* @code
int main () {
using namespace std;
collatz_solve(cin, cout);
return 0;
}
* @endcode
*/
#ifndef Collatz_h
#define Collatz_h
// --------
// includes
// --------
#include <iostream> // istream, ostream
#include <string> // string
#include <utility> // pair
using namespace std;
// ------------
// collatz_read
// ------------
/**
* @breif read an int from r
* @param r an istream
* @return the int
*/
int collatz_read (istream& r);
// ------------
// collatz_eval
// ------------
/**
* @param n the end of the range [1, n], inclusive
* @return the value that produces the max cycle length of the range [1, n]
*/
int collatz_eval (long long n);
// -------------
// collatz_print
// -------------
/**
* @breif print an int to w
* @param w an ostream
* @param m the max cycle length
*/
void collatz_print (ostream& w, int m);
// -------------
// collatz_solve
// -------------
/**
* @param r an istream
* @param w an ostream
*/
void collatz_solve (istream& r, ostream& w);
#endif // Collatz_h