Cod sursa(job #2453054)
| Utilizator | Data | 2 septembrie 2019 12:43:02 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <fstream>
#include <iostream>
#define N (1 << 21)
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char S[N + 1];
int i, words, LungT;
int main()
{ f.getline(S, N + 1);
for(i = 0; S[i] != 0; i++){
if((S[i] >= 'a' && S[i] <= 'z') ||(S[i] >= 'A' && S[i] <= 'Z')){
while((S[i] >= 'a' && S[i] <= 'z') ||(S[i] >= 'A' && S[i] <= 'Z')){
LungT++;
i++;
}
words++;
}
}
g << LungT / words;
return 0;
}
