Cod sursa(job #2980191)
| Utilizator | Data | 16 februarie 2023 11:30:15 | |
|---|---|---|---|
| Problema | A+B | Scor | 100 |
| Compilator | c-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <stdio.h>
int main()
{
char input_file[] = "adunare.in";
FILE *in = fopen(input_file, "rt");
if (in == NULL)
{
fprintf(stderr, "ERROR: Can't open file %s", input_file);
return -1;
}
int a,b;
fscanf(in, "%d\n%d",&a,&b);
fclose(in);
char output_file[] = "adunare.out";
FILE *out = fopen(output_file, "wt");
if (out == NULL)
{
fprintf(stderr, "ERROR: Can't open file %s", input_file);
return -1;
}
fprintf(out,"%d",a+b);
fclose(out);
return 0;
}
