Cod sursa(job #1004929)

Utilizator razvanb87Razvan Buhaianu razvanb87 Data 3 octombrie 2013 20:17:02
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.78 kb
#include <string.h>
#include <fstream>
#include <iostream>
using namespace std;
    ifstream fin("adunare.in");
    ofstream fout("adunare.out");
int main()
{
    char s[1001],cuv[100][24];
    int n,i=0,t=0,nrn=0,j;
    fin.getline(s,1001,'\n');
    n=strlen(s);
    while(i<n)
    {
        nrn=0;
        if(s[i]==')')
        {
            j=i;
          while(j<n)
          {
              if(s[j+1]==' ')j++;
              else
              {
                  if((s[j+1]>='0')&&(s[j+1]<='9')){ nrn=nrn*10+s[j+1]-'0';j++;}
                  else break;
              }

        }
        }
        t=t+nrn;
        i++;
    }
    for(i=0;i<100;i++)
        for(j=0;j<24;j++)
    {   cuv[i][j]='A';
       // cout<<cuv[i][j];
    }

    return 0;

}