Pagini recente » clasament-arhiva-monthly | Cod sursa (job #1484521) | Clasamentul arhivei Infoarena Monthly | kidsim2 | Cod sursa (job #455382)
Cod sursa(job #455382)
#include <cstdio>
#define FIN "operatii.in"
#define FOU "operatii.out"
#define LIN unsigned int
#define hg 8192
int V, AUX , N, poz;
LIN rez;
char ch[hg];
inline int cit (int &x)
{
x = 0;
if (ch[0]=='\0') fread (ch, 1, hg, stdin);
else while (ch[poz] < '0' || ch[poz] > '9')
if (++poz == hg)
fread (ch, 1, hg, stdin), poz = 0;
while (ch[poz] >= '0' && ch[poz] <= '9')
{
x = x * 10 + ch[poz] - '0';
if (++poz == hg)
fread (ch, 1, hg, stdin), poz = 0;
}
return x;
}
int main()
{
freopen(FIN , "r" , stdin);
freopen(FOU , "w" , stdout);
cit(N);
for (int i = 1; i <= N; AUX = V, i++)
if ( cit(V) > AUX)
rez += V - AUX;
printf("%u", rez);
return 0;
}