Cod sursa(job #2177626)
| Utilizator | Data | 18 martie 2018 18:38:35 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[100000];
int n, l, ok, cuv;
int main()
{
f.getline(s, 100001);
for(int i=0; i<=strlen(s); i++){
if((s[i] <= 'z' && s[i] >= 'a') || (s[i] <= 'Z' && s[i] >='A')){
ok = 1;
l++;
}else{
if(ok == 1) cuv ++;
ok = 0;
}
}
g<<l/cuv<<'\n';
return 0;
}
