Mai intai trebuie sa te autentifici.
Cod sursa(job #1742220)
Utilizator | Data | 15 august 2016 23:06:53 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <cstdio>
using namespace std;
bool litera(char c){
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
return 1;
return 0;
}
void cuvant(int &n, char c){
while (litera(c)){
n ++;
c = getc(stdin);
}
}
int main(){
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
int n, cuv;
char c;
c = getc(stdin);
n = cuv = 0;
while (c != EOF){
if (litera(c)){
cuvant(n, c);
cuv ++;
}
c = getc(stdin);
}
printf("%d\n", n / cuv);
return 0;
}