Cod sursa(job #455375)
| Utilizator | Data | 13 mai 2010 17:26:16 | |
|---|---|---|---|
| Problema | Operatii | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <cstdio>
const char FIN[] = "operatii.in";
const char FOU[] = "operatii.out";
long long V, AUX , N, rez;
int main()
{
freopen(FIN , "r" , stdin);
freopen(FOU , "w" , stdout);
scanf("%lld", &N);
for (int i = 1; i <= N; AUX = V, i++)
{
scanf("%lld", &V);
if ( V > AUX)
rez += V - AUX;
}
printf("%lld", rez);
return 0;
}
