Cod sursa(job #945887)
Utilizator | Data | 3 mai 2013 11:28:09 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int i,j,l,lm;
char c;
int main()
{
while(f>>noskipws>>c){if(c>'A'&&c<='z')lm++;
else if(c==' '&&lm>0)l++;
else if(c=='-'&&lm>0)l++; }l++;
g<<lm/l;
f.close();
g.close();
return 0;
}