Cod sursa(job #1218737)
Utilizator | Alex M forever16 | Data | 12 august 2014 14:04:49 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int text, litere=0, cuvinte=0;
bool cuv=false;
int main()
{
while(!f.eof()) {
text=f.get();
if ((text>=65 && text<=90) || (text>=97 && text<=122))
{ litere++;
cuv=true; }
else if (cuv==true)
{ cuvinte++;
cuv=false; } ; }
g<<litere/cuvinte;
return 0;
}