Cod sursa(job #2340630)
Utilizator | Data | 10 februarie 2019 19:14:56 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[500001];
int n,nrc,lc;
int main(){
int li,ls;
int i;
f.getline(s,500001);
n=strlen(s);
for(i=0; i<n; i++)
if(isalpha(s[i])){
nrc++;
li=i;
i++;
while(isalpha(s[i]) && i<n)
i++;
i--;
ls=i;
lc+=ls-li+1;
}
if(nrc)
n=lc/nrc;
g<<n;
return 0;
}