Cod sursa(job #779097)
Utilizator | Data | 16 august 2012 17:04:27 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include<fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main ()
{
char s[1000];
in.getline(s,1000);
unsigned short p=0,k=0;
bool cor=0;
int i;
for(i=1;i<strlen(s);i++)
{
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
{ p++;
if(cor==0)
{ k++;
cor=1;
}
}
else
cor=0;
}
out<<p/k;
}