theme changed

This commit is contained in:
nik
2025-09-30 08:21:09 +03:00
parent 4c261f7def
commit 8bd93df2ae
917 changed files with 15023 additions and 0 deletions

44
labs/lab4/Utils/Utils.cs Normal file
View File

@@ -0,0 +1,44 @@
class Utils
{
public static int Greater(int a, int b)
{
if (a > b)
return a;
else
return b;
}
public static void Swap(ref int a, ref int b)
{
int temp = a;
a = b;
b = temp;
}
public static bool Factorial(int n, out int answer)
{
int k;
int f = 1;
bool ok = true;
try
{
checked
{
for (k = 2; k <= n; ++k)
{
f = f * k;
}
}
}
catch (Exception)
{
f = 0;
ok = false;
}
answer = f;
return ok;
}
}