Cod sursa(job #1294749)
| Utilizator | Data | 18 decembrie 2014 06:57:18 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream in("text.in");
ofstream out("text.out");
string s;
int i,t=0,cuv=0;
bool a=true;
getline(in,s);
if ((s[0]>='A'&&s[0]<='Z')||(s[0]>='a'&&s[0]<='z'))cuv=1;
for (i=0;i<s.length();i++)
{
if ((s[i]>='A'&&s[i]<='Z')||(s[i]>='a'&&s[i]<='z'))
{
t++;
a=true;
}
else if (a)
{
a=false;
cuv++;
}
}
out<<t/cuv;
}
