Cod sursa(job #166240)

Utilizator existenceMorut Razvan existence Data 27 martie 2008 18:38:41
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.63 kb
/* by EXISTENCE ( Morut Razvan - Liceul Teoretic "Vasile Goldis", Arad) */

#include <stdio.h>

FILE *f,*g;

 int citeste(long &a, long &b) ;
 long rezolva(long a, long b) ;
 int scrie(long s) ;

int main()
 {long a,b,x;
  citeste(a,b) ;
  x=rezolva(a,b) ;
  scrie(x) ;
  return 0 ;
 }

long rezolva(long a, long b)
 {long s;
  s=a+b;
  return (s) ;
 }

int citeste(long &a, long &b)
 {
  f=fopen("adunare.in","r") ;
  fscanf ( f , "%d\n",&a);
  fscanf ( f , "%d",&b);
  fclose(f);
  return 0 ;
 }

int scrie(long s)
 {
  g=fopen("adunare.out","w") ;
  fprintf (g, "%d", s);
  fclose(g);
  return 0;
 }