init commit

This commit is contained in:
2025-04-13 21:48:15 +03:00
commit 23255e9121
192 changed files with 12200 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#include <stdio.h>
#include <stdint.h>
#include <errno.h>
#include <stdlib.h>
#include <math.h>
enum
{
PRCN = 10000,
};
int
main(int argc, char *argv[])
{
long double a = 0;
for (int i = 1; i < argc; i++) {
char *p;
errno = 0;
long double val = strtod(argv[i], &p);
if (*p || errno || argv[i] == p) {
return 1;
}
if (i == 1) {
a = val * PRCN;
} else {
a = round(a * (100.L + val) / 100.L);
}
}
if (argc == 1) {
return 1;
}
printf("%.4Lf\n", a / PRCN);
return 0;
}