Cod sursa(job #2239525)
Utilizator | Data | 11 septembrie 2018 00:06:44 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<iostream>
#include<fstream>
#include<stdio.h>
using namespace std;
ifstream fin("text.in");
ofstream out("text.out");
int main() {
char c;
int len = 0, cuv = 1;
while (fin.get(c)) {
if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
{
len += 1;
}
else if (c == ' ') {
cuv++;
}
}
out<<len /cuv;
return 0;
}