Cod sursa(job #793617)
Utilizator | Data | 3 octombrie 2012 17:24:02 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<fstream>
#include <iostream>
#include<string.h>
using namespace std;
int s,poz,i,cuv;
char c;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
f>>noskipws>>c; cout<<c;
if((c>='A'&&c<='Z')||(c>='a'&&c<='z'))
{
s++;
poz=1;
}
else
if(poz==1)
{
cuv++;
poz=0;
}
}
g<<s/cuv;
return 0;
}