Cod sursa(job #1766678)

Utilizator OFY4Ahmed Hamza Aydin OFY4 Data 28 septembrie 2016 12:56:46
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.64 kb
#include <string.h>
#include <fstream>

using namespace std;

ifstream in("text.in");
ofstream out("text.out");

int suma, i;
char meh[255];

int main()
{
    while(in >> meh)
    {
        suma+= strlen(meh);
        i = strlen(meh);
        for(int j = 0; j < i; ++j)
        {
            if(meh[j] == ',' ||
               meh[j] == '!' ||
               meh[j] == '?' ||
               meh[j] == '-' ||
               meh[j] == '.' ||
               meh[j] == ':' ||
               meh[j] == '"' ||
               meh[j] == '`')
            {
                --suma;
            }
        }
    }
    out << suma;
}