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