Skip to content

Commit 54e6d62

Browse files
committed
[main] Added functions
1 parent c5d7a6f commit 54e6d62

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

cppProblems/exp_sum/expsum.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using ull = unsigned long long;
2+
3+
ull exp_sum(unsigned int n)
4+
{
5+
if (n == 0)
6+
{
7+
return 0;
8+
}
9+
unsigned long long result = 1;
10+
for (int i = 1; i < n; i++)
11+
{
12+
result *= 1 / 1 - pow(n, i);
13+
}
14+
return result;
15+
}
16+
17+
int main(void)
18+
{
19+
exp_sum(5);
20+
}

pythonProblems/xor/xor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def xor(a, b):
2+
return (a and not b) or (not a and b)

0 commit comments

Comments
 (0)