This commit is contained in:
justuser-31 2025-05-04 21:18:37 +03:00
parent b033d316e8
commit 9b912d396c
6 changed files with 73 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
STEP1_Basics/*/a.out

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "STEP1_Basics/3_Formatting/c_cross_pack"]
path = STEP1_Basics/3_Formatting/c_cross_pack
url = ssh://git@git.del.pw:2222/justuser-31/c_cross_pack.git

View File

@ -0,0 +1,7 @@
#include <stdio.h>
int main() {
printf("Hello world\n");
return 0;
}

View File

@ -0,0 +1,26 @@
#include <stdio.h>
#include <math.h>
int main() {
float x, y;
printf("Enter x: "); scanf("%f", &x);
printf("Enter y: "); scanf("%f", &y);
float sum = x + y;
float sub = x - y;
float mult = x * y;
float div = x / y;
float poww = pow(x, y);
float sqrtt = pow(x, (1/y));
printf("Results:\n"
"sum: %f\n"
"sub: %f\n"
"mult: %f\n"
"div: %f\n"
"pow: %f\n"
"sqrt: %f\n",
sum, sub, mult, div, poww, sqrtt);
return 0;
}

@ -0,0 +1 @@
Subproject commit f9a5352b6e6752375cd3520b28da474285288768

View File

@ -0,0 +1,35 @@
#include <stdio.h>
#include <stdlib.h>
#include "c_cross_pack/libs/string.h"
int main() {
int day, year;
string month = strInit("");
printf("Enter day of month: "); scanf("%d", &day);
printf("Enter month name: "); scanf("%s", month);
printf("Enter year: "); scanf("%d", &year);
string yyyy_mm_dd = strInit(int2Str(&year));
strAdd(&yyyy_mm_dd, "-");
strAdd(&yyyy_mm_dd, month);
strAdd(&yyyy_mm_dd, "-");
strAdd(&yyyy_mm_dd, int2Str(&day));
string dd_mm_yyyy = strInit(int2Str(&day));
strAdd(&dd_mm_yyyy, "-");
strAdd(&dd_mm_yyyy, month);
strAdd(&dd_mm_yyyy, "-");
strAdd(&dd_mm_yyyy, int2Str(&year));
printf("\nResult:\n");
printf("yyyy_mm_dd: %s\n", yyyy_mm_dd);
printf("dd_mm_yyyy: %s\n", yyyy_mm_dd);
free(month);
return 0;
}