Cod sursa(job #1520969)
Utilizator | Data | 9 noiembrie 2015 19:42:29 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<fstream>
using namespace std;
long a,nr,ok,p;
char c;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
f.get(c);
while(p<2)
{
if(c>=65 && c<=90 || c>=97 && c<=122)
{nr++;
ok=1;}
if(c==' ' && ok==1 || c=='-' && ok==1)
a++;
f.get(c);
if(c=='\n')
p++;
}
g<<nr/(a+1);
return 0;
}