Cod sursa(job #1277195)
Utilizator | Data | 27 noiembrie 2014 12:26:21 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<fstream>
using namespace std;
char a;
int sum,counter;
bool flag=0;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
while(fin.get(a))
{
if(flag==0) if ((a>='a' && a<='z') || (a>='A' && a<='Z')) flag=1;
if(flag==1)
{
if ((a>='a' && a<='z') || (a>='A' && a<='Z')) sum++;
else
{
counter++;
flag=0;
}
}
}
fout<<sum/counter;
}