Cod sursa(job #1322970)
Utilizator | Data | 20 ianuarie 2015 16:08:50 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<fstream>
using namespace std;
int main()
{
ifstream fin ("text.in");
ofstream fout ("text.out");
char ch;
int sum=0,l=0;
bool flag=false;
while(!fin.eof())
{
fin.get(ch);
if(ch>=65&&ch<=90)
{
sum++;
flag=true;
}
if(ch>=97&&ch<=122)
{
sum++;
flag=true;
}
if(ch<65||ch>122)
{ if(flag==true)
{
l++;flag=false;
}
}
}
fout<<sum/l;
}