Pagini recente » Cod sursa (job #1105658) | Cod sursa (job #2735812) | Cod sursa (job #3128088) | Cod sursa (job #756700) | Cod sursa (job #2304659)
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[10001],*p;
int nr,x,i,nr1;
bool OK;
int main()
{
f.getline(s,sizeof(s));
for(i=0; s[i]; i++)
{
if(isalpha(s[i]) && !OK)
OK=1,nr++,nr1++;
else if(isalpha(s[i]))
nr1++;
else if(!isalpha(s[i]))
OK=0;
}
g<<nr1<<" "<<nr<<'\n';
g<<nr1/nr;
return 0;
}