Cod sursa(job #833055)
Utilizator | Data | 11 decembrie 2012 20:45:40 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream>
#include<iostream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int x=0,l=0,c=0;
char a;
while(fin.get(a))
{
if(('a'<=a&&a<='z')||('A'<=a&&a<='Z'))l++;
else{
if(l)c++;
x=x+l;
l=0;
}
}
fout<<x/c;
fin.close();
fout.close();
return 0;
}