Cod sursa(job #951264)
Utilizator | Data | 19 mai 2013 21:06:51 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<cstring>
#include<vector>
#include<fstream>
using namespace std;
ifstream in;
ofsrteam out;
int main()
{
in.open("text.in");
out.open("text.out");
char chr;
int some=0,ascii;
int lenght=0,nr=0;
while(in>>chr)
{
ascii=chr;
if((ascii>=97&&ascii<=122) || (ascii>=65&&ascii<=90)
{
lenght++;
some=1;
}
else
{
if(some)
nr++;
some=0;
}
}
out<<lenght/nr;
in.close();
out.close();
return 0;
}