Cod sursa(job #2368057)
| Utilizator | Data | 5 martie 2019 13:34:37 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
#include <fstream>
#include <cstring>
#define nmax 1000004
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int n,tl,w;
char s[nmax];
bool ok;
int main()
{
f.getline(s,1000001);
n=strlen(s);
for (int i=0;i<n;i++)
{
ok=0;
while ((s[i]>='a' && s[i]<='z') || (s[i]>='A' && s[i]<='Z'))
{
ok=1;
tl++;
i++;
}
if (ok==1)
{
w++;
i--;
}
}
g<<tl/w;
f.close();
g.close();
return 0;
}
