Skip to content

Commit bcf50c6

Browse files
committed
Added exam preparation tasks, description and solutions
1 parent 446b002 commit bcf50c6

File tree

251 files changed

+2821
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+2821
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
3+
internal class Vehicles
4+
{
5+
private static void Main()
6+
{
7+
var s = int.Parse(Console.ReadLine());
8+
var count = 0;
9+
10+
int c1 = 4, c2 = 10, c3 = 3;
11+
for (var count1 = 0; count1 <= (s / c1) + 1; count1++)
12+
{
13+
for (var count2 = 0; count2 <= (s / c2) + 1; count2++)
14+
{
15+
for (var count3 = 0; count3 <= (s / c3) + 1; count3++)
16+
{
17+
var all = (count1 * c1) + (count2 * c2) + (count3 * c3);
18+
if (all == s)
19+
{
20+
// Console.WriteLine(count1, count2, count3);
21+
count++;
22+
}
23+
}
24+
}
25+
}
26+
27+
Console.WriteLine(count);
28+
}
29+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
function solve(params) {
2+
var count1,
3+
count2,
4+
count3,
5+
all,
6+
s = +params[0],
7+
count = 0,
8+
c1 = 4,
9+
c2 = 10,
10+
c3 = 3;
11+
12+
for (count1 = 0; count1 <= (s / c1) + 1; count1++) {
13+
for (count2 = 0; count2 <= (s / c2) + 1; count2++) {
14+
for (count3 = 0; count3 <= (s / c3) + 1; count3++) {
15+
all = (count1 * c1) + (count2 * c2) + (count3 * c3);
16+
if (all === s) {
17+
count++;
18+
}
19+
}
20+
}
21+
}
22+
return count;
23+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
10
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
40
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

0 commit comments

Comments
 (0)