Cod sursa(job #225750)
Utilizator | Data | 30 noiembrie 2008 20:17:08 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.95 kb |
#include<fstream>
#include<string.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char a[52]={'q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M'};
int main ()
{
char x[850000];
int n,i,k,cuv=0,lit=0,cuv2=0;
fin.getline(x,85000);
n=i=k=0;
k=strlen(x);
for(i=0;i<=k;i++)
{
if(strchr(a,x[i])==0)
n=0;
else
{ if(n==0)
cuv++;
n=1;
lit++;
}
}
fout<<(lit-1)/(cuv-1);
return 0;
}