Cod sursa(job #860832)
Utilizator | Data | 20 ianuarie 2013 19:30:10 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<fstream>
#include<cstring>
using namespace std;
char s[100000];
long i,lung=0,k,n;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
f.getline(s,100000);
for(i=0;i<strlen(s);i++)
{
if(('a'<=s[i] && s[i]<='z')||('A'<=s[i] && s[i]<='Z'))
lung++;
else if(lung)
{
n=n+lung;
k++;
lung=0;
}
}
g<<n/k;
}