Cod sursa(job #1167415)

Utilizator deneoAdrian Craciun deneo Data 4 aprilie 2014 22:35:13
Problema A+B Scor 100
Compilator cpp Status done
Runda Lista lui wefgef Marime 0.64 kb
#include <iostream>
#include <cstdio>
using namespace std;

const int MAXBUFF = 100000;
char buff[MAXBUFF];

#define next ++poz; if (poz >= MAXBUFF) { poz = 0; fread(buff, 1, MAXBUFF, stdin); }

int get_int() {
    static int poz = MAXBUFF;
    while (buff[poz] < '0' || buff[poz] > '9') {next}

    int nr = 0;

    while (buff[poz] >= '0' && buff[poz] <= '9') {
        nr = nr * 10 + buff[poz] - '0';
        next;
    }
    return nr;
}

int main() {
    freopen("adunare.in", "r", stdin);
    freopen("adunare.out", "w", stdout);

    int a = get_int();
    int b = get_int();

    printf ("%d", a + b);
    return 0;
}