Cod sursa(job #1402857)
Utilizator | Data | 26 martie 2015 21:33:31 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int l,cuvinte;
char c;
bool ok;
int main()
{
while (fin.get(c))
{
if ((c>='a' && c<='z') || (c>='A' && c<='Z'))
{
l++;
ok=true;
}
else
if (ok==true)
ok=false, cuvinte++;
}
fout << l / cuvinte;
return 0;
}