Cod sursa(job #1821514)
| Utilizator | Data | 3 decembrie 2016 11:34:52 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | x_test2 | Marime | 0.52 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream cin ("text.in");
ofstream cout ("text.out");
int n, nr, s, ok, i;
char c[1048677], aux[1048677], *p;
int main ()
{
cin.getline(c, 1048577);
n=strlen(c);
nr=0;
s=0;
for (i=0; i<n; i++){
if ((c[i]>='a' && c[i]<='z') || (c[i]>='A' && c[i]<='Z')){
s++;
if (c[i+1]<'A' || c[i+1]>'z' || c[i+1]<'a' && c[i+1]>'Z') nr++;
}
}
// cout << s << " " << nr << '\n';
cout << s/nr;
}
