Cod sursa(job #997512)
| Utilizator | Data | 14 septembrie 2013 12:58:19 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <iostream>
#include <cstdio>
#include <string>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
short int litere=0,cuvinte=0;
char c;
int main()
{
bool ok;
while (!f.eof())
{
f.get(c);
if (((c>='a') && (c<='z')) || ((c>='A')&& (c<='Z')))
{
++litere;
ok=true;
}
else if (ok)
{
++cuvinte;
ok=false;
}
}
f.close();
g<<litere/cuvinte;
return 0;
}
