Pagini recente » Cod sursa (job #87318) | Cod sursa (job #2131179) | Rating george topolodan (titumaiorescu) | Cod sursa (job #2333599) | Cod sursa (job #2515051)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char text[1024*1024+1];
int nrl, nrc, i=0;
int main()
{
fin.getline(text,1024*1024+1);
while(text[i]!='\n')
{
if(((text[i-1]>='A' && text[i-1]<='Z') || (text[i-1]>='a' && text[i-1]<='z')) && !isalpha(text[i]) && i!=0)
nrc++;
else if((text[i]>='A' && text[i]<='Z') || (text[i]>='a' && text[i]<='z'))
nrl++;
i++;
}
fout<<nrl/nrc;
return 0;
}