Skip to content

Commit

Permalink
fix: example files
Browse files Browse the repository at this point in the history
  • Loading branch information
pgagnidze committed Jun 6, 2023
1 parent 73e9621 commit c547f67
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 56 deletions.
60 changes: 60 additions & 0 deletions example/algo.ena
@@ -0,0 +1,60 @@
ფუნქცია ეილერი1() {
სულ = 0
ნ = 1000
ი = 0
სანამ ი < ნ {
თუ ი % 3 == 0 || ი % 5 == 0 {
სულ = სულ + ი
};
ი = ი + 1
};
დააბრუნე სულ
}

ფუნქცია ეილერი2() {
სულ = 0
ნ = 4000000
ა = 1
ბ = 2
სანამ ბ <= ნ {
თუ ბ % 2 == 0 {
სულ = სულ + ბ
};
შემდეგი = ა + ბ
ა = ბ
ბ = შემდეგი
};
დააბრუნე სულ
}

ფუნქცია ერატოსთენის_საცერი(n) {
სია = ახალი[n+1] ჭეშმარიტი
სია[1] = მცდარი
i = 2
სანამ i * i <= n {
თუ სია[i] == ჭეშმარიტი {
j = i * i
სანამ j <= n {
სია[j] = მცდარი
j = j + i
}
}
i = i + 1
}
დააბრუნე სია
}

ფუნქცია მთავარი() {
@ "
ეილერი 1
"
მაჩვენე ეილერი1()
@ "
ეილერი 2
"
მაჩვენე ეილერი2()
@ "
ერატოსთენის საცერი
"
მაჩვენე ერატოსთენის_საცერი(10)
}
12 changes: 0 additions & 12 deletions example/euler1.ena

This file was deleted.

15 changes: 0 additions & 15 deletions example/euler2.ena

This file was deleted.

29 changes: 0 additions & 29 deletions example/euler3.ena

This file was deleted.

0 comments on commit c547f67

Please sign in to comment.