Cod sursa(job #330205)
Utilizator | Data | 9 iulie 2009 09:40:21 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<iostream>
#include<fstream>
#include<string.h>
#include<ctype.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char txt[30];
int nr=0,lung=0,i;
while(f>>txt)
{lung=lung+strlen(txt);
for(i=0;i<strlen(txt);i++)
if(!isalpha(txt[i]))
lung--;
nr++;
}
cout<<lung;
g<<lung/nr;
g.close();
f.close();
return 0;
}