Cod sursa(job #1322960)
| Utilizator | Data | 20 ianuarie 2015 15:57:41 | |
|---|---|---|---|
| Problema | Text | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 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=true;
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){
// fout<<ch<<" ";
l++;
//fout<<l<<" ";
flag=false;}}
}
fout<<sum/(l-1);
}
