Cod sursa(job #748916)
Utilizator | Data | 15 mai 2012 09:50:48 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <fstream>
#include <cctype>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int s;
bool opened=false;
char c;
int l=0,nrcuv=0;
while(fin.get(c))
{
if(isalpha(c))
{
l++;
opened=true;
}
else
{
if(opened)
nrcuv++;
opened=false;
}
}
fout<<l/nrcuv<<'\n';
fin.close();
fout.close();
return 0;
}