Cod sursa(job #938996)
| Utilizator | Data | 14 aprilie 2013 18:31:13 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <fstream>
#define In "text.in"
#define Out "text.out"
using namespace std;
inline bool Este_lit(char ch)
{
return (('a'<=ch && ch<='z' )||('A'<=ch && ch<='Z'));
}
int main()
{
int c=0,cuv=0;
char ch,ch1 = 0;
ifstream f(In);
while(!f.eof())
{
f.get(ch);
if(Este_lit(ch)==true)
{
c++;
if(Este_lit(ch1)==false)
cuv++;
}
ch1 =ch;
}
f.close();
ofstream g(Out);
g<<c/cuv<<"\n";
g.close();
return 0;
}
