Cod sursa(job #1994351)
| Utilizator | Data | 24 iunie 2017 19:30:25 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <iostream>
#include<fstream>
using namespace std;
int main()
{
ifstream fin ("text.in");
ofstream fout ("text.out");
char litera;
int cuvinte = 0;
int spatii = 0;
bool cuvant = false;
while(! fin.eof())
{
fin.get(litera);
if((litera>='a' && litera<='z') || (litera>='A' && litera<='Z') && !cuvant)
{
cuvinte++;
cuvant = true;
}
else
spatii++;
}
cout << cuvinte/spatii;
return 0;
}
