Cod sursa(job #945517)

Utilizator robertstrecheStreche Robert robertstreche Data 2 mai 2013 10:47:31
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <fstream>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");
char c,cc;
int n,nr;
int main()
{
    while (c!='\n')
    {
        f>>noskipws>>c;
        if ((c==' ' ||c=='.' || c=='-' || c=='?' || c=='!') && cc!='.' && cc!='-' && cc!='?' && cc!='!')nr++;
        if (c!=' ' && c!=',' && c!='\n' && c!='.' && c!='-' && c!='?' && c!='!')n++;
        cc=c;
    }
    g<<n/nr;
   f.close();
   g.close();
}