Cod sursa(job #1878669)
| Utilizator | Data | 14 februarie 2017 12:49:48 | |
|---|---|---|---|
| Problema | Text | Scor | 80 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <fstream>
#include <cstring>
using namespace std;
char s[100000000001],*p;
ifstream f("text.in");
ofstream g("text.out");
long long nrcuv,lit;
int main()
{
while(f.getline(s,100000000001))
{
p=strtok(s," -;,:?!");
while(p)
{
nrcuv++;
for(int i=0;i<strlen(p);i++)
if((p[i]>='a' && p[i]<='z') || (p[i]>='A' &&p[i]<='Z'))
lit++;
p=strtok(NULL," -;,:?!");
}
}
g<<lit/nrcuv;
f.close();g.close();
return 0;
}
