Cod sursa(job #583981)

Utilizator wamfeverDobos Ionut wamfever Data 23 aprilie 2011 14:46:47
Problema Text Scor 60
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include<fstream>
#include<algorithm>
#include<cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");

int main()
{
    char sepc[]=".,!- ;?";
    char p[17000], c[32];
    int i,nr=0,lg=0;
    fin>>c;
    while( !fin.eof() )
    {
           fin>>p;
           for(i=0;i<strlen(p);i++) if(p[i] != '!' && p[i] != '.' && p[i] != ',' && p[i] != '?' && p[i] != ';' && p[i] != ';' && p[i] != '-' ) lg++;
           nr++;

    }
    fout<<lg/nr;
    fin.close();
    fout.close();
    return 0;
}