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