-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem5.cpp
More file actions
executable file
·85 lines (65 loc) · 1.07 KB
/
Problem5.cpp
File metadata and controls
executable file
·85 lines (65 loc) · 1.07 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Problem5.cpp
*
* Created on: Dec 1, 2014
* Author: explicitname
*/
#include <iostream>
#include <vector>
using namespace std;
int main()
{
int j = 0;
<<<<<<< HEAD
int isDivisible = 0;
=======
int isDivisble = 0;
>>>>>>> 389110ad561ba0c76777edee3fd5326b76ffc3c7
cout
<< "This program will find the smallest number that is evenly divisble by all the numbers from 1 through 20."
<< endl;
cout << "..." << endl;
cout << "..." << endl;
cout << "..." << endl;
cout << "..." << endl;
cout << "..." << endl;
cout << "..." << endl;
<<<<<<< HEAD
while (true)
{
j++;
if (j % 20 == 0)
{
isDivisible = 0;
for (int i = 11; i < 20; i++)
{
if (!(j % i))
{
isDivisible++;
}
}
if (isDivisible == 9)
{
cout << j << endl;
break;
}
}
}
return 0;
}
=======
while (true) {
j++;
for (int i = 11; i < 21; i++) {
if (j % i == 0) {
isDivisble++;
}
}
if (isDivisble == 20) {
break;
}
}
cout << "The answer is: " << j << endl;
return 0;
}
>>>>>>> 389110ad561ba0c76777edee3fd5326b76ffc3c7