Cod sursa(job #1756996)

Utilizator DobosDobos Paul Dobos Data 14 septembrie 2016 09:51:17
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.84 kb
#include <bits/stdc++.h>

using namespace std;

ifstream fin("apel.in");
ofstream fout("apel.out");
char s[250], *p = s, *P;
string sa,S[27];
int v[27],V[27];
int tr(const char &a){
    return a - 'a' + 1;
}
int Tr(const char &A){
    return A - 'A' + 1;
}
int main()
{
    ios :: sync_with_stdio(false);
    fin.tie(NULL);

    fin >> s;
    do{
        sa.clear();
        fin >> sa;
        for(int i = 2; isdigit(sa[i]); i++)
            v[tr(sa[0])] = v[tr(sa[0])] * 10 + sa[i] - '0';

    }while(sa[0] <= 'z' && sa[0] >= 'a');

    do{
        S[Tr(sa[0])] = sa;
    } while(fin >> sa);

    int n = 0;
    while(*p != '/n'){
        *p++;
        n++;
        for(isdigit(*p);*p++)
        V[n] = V[n]*10 + *p - '0';
        if(*p <= 'z' && *p >= 'a')
            V[n] = v[tr(*p)];


    }

    return 0;
}