Cod sursa(job #385764)
Utilizator | Data | 23 ianuarie 2010 14:22:23 | |
---|---|---|---|
Problema | A+B | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
// suma.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<conio.h>
#include<string.h>
#include<stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
int a,b;
char nume1[10],nume2[10];
FILE *f,*g;
printf("dati fisierul de intrare ");
gets(nume1);
printf("dati fisierul de iesire ");
gets(nume2);
f=fopen(nume1,"rt");
g=fopen(nume2,"wt");
fscanf(f,"%d",&a);
fscanf(f,"%d",&b);
fprintf(g,"%d",a+b);
fcloseall();
getch();
return 0;
}