Pagini recente » Cod sursa (job #2833631) | Cod sursa (job #321685) | Cod sursa (job #294732) | Cod sursa (job #2844928) | Cod sursa (job #1207620)
#include <fstream>
using namespace std;
char c,o;
long long a=0,b=0;
bool corespunde(char c)
{
int x=c;
if ((65<=x && x<=90)||(97<=x && x<=122))
return true;
return false;
}
int main()
{
ifstream fi("text.in");
ofstream fo("text.out");
fi.get(o);
if (corespunde(o))
{
a++;
b++;
}
while (! fi.eof())
{
fi.get(c);
if (corespunde(c))
++a;
if (corespunde(c) && !corespunde(o))
++b;
o=c;
}
fo<<a/b;
}