Cod sursa(job #1052835)
| Utilizator | Data | 11 decembrie 2013 20:48:02 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream is ("text.in");
ofstream os ("text.out");
char v[10000001];
int w, l, n;
int main()
{
is.getline(v, 10000000, EOF);
n = strlen(v);
for (int i = 0; i < n; ++i)
if (isupper(v[i]) || islower(v[i]))
{
w++;
while (isupper(v[i]) || islower(v[i]))
{
i++;
l++;
}
}
os << l/w;
is.close();
os.close();
return 0;
}
