Cod sursa(job #810705)
Utilizator | Alexandru Valeanu AlexandruValeanu | Data | 10 noiembrie 2012 20:43:52 |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
char s[1000];
int t=0;
int len=0,cuv=0,i;
ifstream f("text.in");
ofstream g("text.out");
f.get(s,1000);
for(i=0;i<strlen(s);i++)
{
if((s[i]>=65 && s[i]<=90) || (s[i]>=97 && s[i]<=122))
{
len++;
if(t==0)
{
cuv++;
t=1;
}
}
else
t=0;
}
g<<len/cuv;
return 0;
}