Cod sursa(job #953520)
Utilizator | Data | 26 mai 2013 14:14:08 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
long long cuv,l;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char s,cop;
cuv=0;
while(!f.eof())
{
f>>s;
if(isalpha(s))
{
l++;
if(isalpha(cop)==0)
cuv++;
}
cop=s;
}
if(isalpha(s)==1)
cuv++;
g<<(int)l/cuv;
f.close();
g.close();
return 0;
}