Cod sursa(job #2135660)
| Utilizator | Data | 19 februarie 2018 00:02:28 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.59 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in"); ofstream g("text.out");
char s[100000005];
int main() {
f.getline(s,100000005);
int n,nr,i; bool nou = 1;
string ss = s;
n = 0; nr = 0;
for(i = 0; i <= ss.length()-1; ++i) {
if (((s[i] >= 'a') && (s[i] <= 'z')) || ((s[i] >= 'A') && (s[i] <= 'Z'))) {
++n;
if (nou) {
nou = 0;
++nr;
}
}
else {
nou = 1;
}
}
g<<n / nr;
return 0;
}
