Работы по программированию

This commit is contained in:
IgorVolochay
2026-07-28 09:56:54 +03:00
parent b85155ff95
commit 8602b7e845
73 changed files with 4090 additions and 0 deletions
@@ -0,0 +1,40 @@
#include <stdio.h>
int main() {
FILE *initialFile = fopen("1 input.txt", "w");
if (initialFile == NULL) {
printf("Не удалось создать файл 1 input.txt\n");
return 1;
}
fprintf(initialFile, "5 6 1 10 24\n");
fclose(initialFile);
FILE *inputFile = fopen("1 input.txt", "r");
if (inputFile == NULL) {
printf("Не удалось открыть файл 1 input.txt\n");
return 1;
}
FILE *outputFile = fopen("1 output.txt", "w");
if (outputFile == NULL) {
printf("Не удалось открыть файл 1 output.txt\n");
fclose(inputFile);
return 1;
}
float a, b, c, d, e;
fscanf(inputFile, "%f %f %f %f %f", &a, &b, &c, &d, &e);
fclose(inputFile);
float result = ((a / b) + (c / d)) * e;
fprintf(outputFile, "%.2f\n", result);
fclose(outputFile);
printf("output.txt\n");
return 0;
}