Cod sursa(job #565248)
| Utilizator | Data | 27 martie 2011 14:19:45 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.42 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(fin>>a)
if((a>='a' && a<='z') || (a>='A' && a<='Z'))
{n++;
if(ok==0) c++;
ok=1;
}
else ok=0;
if(c!=0)
fout<<n/(c-1);
else fout<<-1;
fin.close();
fout.close();
return 0;
}
