Cod sursa(job #1574805)

Utilizator RG1999one shot RG1999 Data 20 ianuarie 2016 20:59:34
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <cstdio>
using namespace std;
char c;
int nr1,nr2,ok;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    nr1=0;
    nr2=0;
    ok=1;
    while(scanf("%c",&c)>0)
    {
        if(c!=' '&&c!='\n'&&c!='-'&&c!='!'&&c!=','&&c!='.'&&c!='?')
            nr1++;
         if(c!=' '&&c!='\n'&&c!='!'&&c!=','&&c!='.'&&c!='?'&&ok==1)
         {nr2++;
         ok=0;
         }
         if(c==' ')
            ok=1;

    }
   printf("%d",nr1/nr2);
    return 0;
}