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