Cod sursa(job #2037714)
Utilizator | Data | 12 octombrie 2017 18:12:45 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <fstream>
using namespace std;
int main()
{
ifstream in("text.in");
ofstream out("text.out");
char prop;
int cuv,lung,nrc;
while(in>>noskipws>>prop)
{
if(isalpha(prop))
cuv++;
else
{
if(cuv!=0)
{
lung+=cuv;
cuv=0;
nrc++;
}
}
}
out<<lung/nrc;
return 0;
}