Cod sursa(job #2265005)
| Utilizator | Data | 20 octombrie 2018 14:48:00 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include <fstream>
#include <vector>
#include <bitset>
#include <unordered_map>
#include <algorithm>
#include <queue>
#include <math.h>
#include <iomanip>
#include <stack>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
int words;
int letters;
int main()
{
char c;
int prev = 0;
while(cin.get(c))
{
if(isalpha(c))
{
if(prev == 0)
words++;
letters++;
prev = 1;
}
else
prev = 0;
}
words += prev;
cout << letters / words;
}