Cod sursa(job #2616128)
| Utilizator | Data | 16 mai 2020 19:50:13 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <fstream>
#define dim 1000010
using namespace std;
char a[dim];
int i,cuvinte,litere;
int esteCifra(char a) {
if (islower(a)||isupper(a)) return 1;
return 0;
}
int main() {
ifstream fin("text.in");
ofstream fout("text.out");
fin.getline(a,dim);
for (i=0;a[i]!=0;i++) {
if ((i==0&&esteCifra(a[i]))||(esteCifra(a[i])&&!esteCifra(a[i-1]))) {
cuvinte++;
}
if (esteCifra(a[i])) {
litere++;
}
}
fout<<litere/cuvinte;
return 0;
}
