Skip to content

Commit d3661b6

Browse files
committed
Problemi 01 Euler
1 parent 4256d21 commit d3661b6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Diff for: euler01

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ using namespace std;
33

44
int main()
55
{
6-
int sh;
76

8-
cout << "Shumefishi i 3 ose 5: ";
9-
cin >> sh;
10-
cout << endl;
7+
int shuma=0;
118

12-
for (int i = 0; i < 1000; i++) {
13-
if (i % 3 == 0 || i % 5 == 0)
9+
for(int i=1; i<=1000; i++){
10+
if( i%3 ==0 || i%5 ==0) {
1411

1512
cout << i << ", ";
13+
14+
shuma += i;
1615
}
17-
16+
}
17+
cout << endl << "Shuma e numrave: "<< shuma << endl;
18+
1819
return 0;
1920
}

0 commit comments

Comments
 (0)