Cod sursa(job #2426144)

Utilizator MoldooooooooMoldoveanu Stefan Moldoooooooo Data 26 mai 2019 13:28:25
Problema Obiective Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.68 kb
#include <iostream>
#include <cstdio>
using namespace std;
int N, M, T, i, j, k;
char C[20];
int Parse();
int main()
{
    freopen("obiective.in", "r", stdin);
    freopen("obiective.out", "w", stdout);
    fgets(C, 20, stdin); k=-1;
    N=Parse(); M=Parse();
    for(i=1; i<=M; ++i){
        int x, y;
        fgets(C, 20, stdin); k=-1;
        x=Parse(); y=Parse();
    }
    fgets(C, 20, stdin); k=-1;
    T=Parse();
    for(i=1; i<=T; ++i){
        int x, y;
        fgets(C, 20, stdin); k=-1;
        x=Parse(); y=Parse();
    }
    return 0;
}
int Parse(){
    ++k;
    int nr=0;
    while(C[k]!=' ' && C[k]!='\n'){nr=nr*10+(C[k]-'0'); ++k;}
    return nr;
}