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
Executable
+33
View File
@@ -0,0 +1,33 @@
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <string.h>
int
main(int argc, char **argv)
{
int mas[5] = {0, 0, 0, 0, 0};
int num = 5, tmp;
while (scanf("%d", &tmp) == 1) {
for (int i = 0; i < 4; i++) {
mas[i] = mas[i + 1];
}
mas[4] = tmp;
num--;
}
// if (num < 0) {
// num = 0;
// }
num = num < 0 ? 0 : num;
for (int i = num; i < 5; i++) {
printf("%d ", mas[i]);
}
printf("\n");
return 0;
}