Cod sursa(job #1200746)
Utilizator | Data | 23 iunie 2014 14:47:31 | |
---|---|---|---|
Problema | Text | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include<fstream>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
int kca, kcu;
char c;
int main()
{
c=f.get();
while (c!=-1)
{
while (('a'<=c && c<='z') || ('A'<=c && c<='Z'))
{
kca++;
c=f.get();
}
if (c==' ')
kcu++;
c=f.get();
}
kcu++;
g<<kca/kcu;
g.close();
return 0;
}