Cod sursa(job #565260)

Utilizator alexutzu29Alexandru Meterez alexutzu29 Data 27 martie 2011 14:23:26
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
   char a;
   int n=0,c=0;
   int ok=0;
   while(scanf("%c",&a)!=EOF)
   if((a>='a' && a<='z') || (a>='A' && a<='Z'))
   {n++;
   if(ok==0) c++;
   ok=1;
   }
   else ok=0;
   
	
	if((c-1)!=0)
   fout<<n/c;
   else fout<<-1;
   fin.close();
   fout.close();
   return 0;
}