Cod sursa(job #997951)
Utilizator | Data | 15 septembrie 2013 12:27:34 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <fstream>
#include <cctype>
using namespace std;
char C, Prev = '.';
int N, W;
int main()
{
ifstream cin("text.in");
ofstream cout("text.out");
while(cin.get(C))
{
if(islower(C) || isupper(C)) N ++;
if((islower(C) || isupper(C)) && !islower(Prev) && !isupper(Prev)) W ++;
Prev = C;
}
cout << N / W;
return 0;
}