Cod sursa(job #1673473)
Utilizator | Data | 3 aprilie 2016 20:44:19 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream f("text.in");
char x;
int cuv=1,l=0;
while(f.get(x))
{
if(x>='A'&&x<='Z' || x>='a'&& x<='z')
l++;
if(x==' ' || x=='-')
{
if(l)cuv++;
}
}
ofstream g("text.out");
g<<l/cuv;
g.close();
return 0;
}