Cod sursa(job #880055)
| Utilizator | Data | 16 februarie 2013 10:56:58 | |
|---|---|---|---|
| Problema | Operatii | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.37 kb |
// operatii.cpp : Defines the entry point for the console application.
//
//#include "stdafx.h"
#include "fstream"
using namespace std;
int main()
{
ifstream f("operatii.in");
ofstream g("operatii.out");
int nr;
f>>nr;
long long e;
long long i,max=0,op=0;
for(i=0;i<nr;i++)
{
f>>e;
if(e>max)
op=op+(e-max);
max=e;
}
g<<op;
return 0;
}
