Cod sursa(job #145847)

Utilizator alex@ndraAlexandra alex@ndra Data 29 februarie 2008 16:28:41
Problema Reuniune Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.32 kb
#include<fstream>
using namespace std;
int main()
{long x1, x2, y1, y2,s, a=0, p1, p2=0;
int i;
ifstream f("reuniune.in");
for(i=1;i<=3;i++)
{f>>x1>>y1>>x2>>y2;
  s=(x2-x1)*(y2-y1);
  p1=2*(x2-x1)+2*(y2-y1);
 a=a+s;
 p2=p2+p1;} 
 ofstream g("reuniune.out");
   g<<a<<" "<<p2;
 f.close();
 g.close();
 return 0;
}