Cod sursa(job #502110)
| Utilizator | Data | 17 noiembrie 2010 19:23:11 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char a;
int nrc = 0, nrl = 0, k = 0;
while( fin.get(a) )
{
if( isalpha(a) )
{
nrl++;
if( k == 0 )
nrc++;
k = 1;
}
else
k = 0;
}
fout << nrl/nrc << '\n';
fin.close();
fout.close();
return 0;
}
