Pagini recente » Cod sursa (job #437956) | Cod sursa (job #1319529) | Cod sursa (job #502515) | Cod sursa (job #3239879) | Cod sursa (job #1820366)
#include <fstream>
#include <string>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int txt(string s)
{
int n=0,c=0,k=0;
s.push_back(' ');
for (int i=0;i<s.size();i++)
{
if (s[i]>=97 && s[i]<=122 || s[i]>=65 && s[i]<=90)
{
n++;
if (s[i+1]<65 || s[i+1]>122 || s[i+1]>90 && s[i+1]<97 )
{
k++;
}
}
}
return n/k;
}
main()
{
string s;
getline(in,s);
out<<txt(s);
}