Cod sursa(job #3129738)
| Utilizator | Data | 15 mai 2023 18:25:05 | |
|---|---|---|---|
| Problema | A+B | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int adunare(int a, int b)
{
return a + b;
}
int main()
{
int a,b;
FILE* f = fopen("adunare.in", "r");
if (f == NULL)
{
printf("Empty file!");
exit(1);
}
fscanf(f, "%d\n%d", &a, &b);
fclose(f);
f = fopen("adunare.out", "w");
if (f == NULL)
{
printf("Nu s-a putut deschide fisier!");
exit(1);
}
fprintf(f, "%d", adunare(a, b));
fclose(f);
return 0;
}