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
+38
View File
@@ -0,0 +1,38 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>
int
main()
{
pid_t pid;
int n;
if (scanf("%d", &n) != 1) {
return 1;
}
for (int i = 1; i <= n; i++) {
printf("%d", i);
fflush(stdout);
if (i == n) {
printf("\n");
return 0;
} else {
printf(" ");
fflush(stdout);
}
pid = fork();
if (!pid) {
continue;
} else {
wait(NULL);
return 0;
}
}
return 0;
}