Cod sursa(job #627738)
| Utilizator | Data | 30 octombrie 2011 16:33:13 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <cstdio>
#define DN 1024*1025
using namespace std;
char x[DN];
int main()
{
int nrcuv=0,nrlitere=0;
freopen("text.in","r", stdin);
freopen("text.out","w", stdout);
fgets(x,1000005,stdin);
bool ok=false;
for(int j=0;x[j]!=0;j++)
{
ok=false;
while((x[j]>='a' && x[j]<='z') || (x[j]>='A' && x[j]<='Z'))
{
nrlitere++;
j++;
ok=true;
}
if(ok==true) nrcuv++;
//if(x[j]=='!' || x[j]=='?' || x[j]=='.') break
}
printf("%d %d %d",nrlitere,nrcuv,nrlitere/nrcuv);
return 0;
}
