Cod sursa(job #1225430)
Utilizator | Data | 2 septembrie 2014 16:11:55 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <cstdio>
using namespace std;
int main() {
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
char a = ' ';
char c;
int l = 0, w = 0;
while(scanf("%c", &c) != EOF ) {
if(c >= 'a' && c <= 'z') {
c -= 'a' - 'A';
}
if(c >= 'A' && c <= 'Z') {
l++;
if(a < 'A' || a > 'Z') {
w++;
}
}
a = c;
}
printf("%d", l / w);
return 0;
}