Cod sursa(job #641802)
| Utilizator | Data | 29 noiembrie 2011 17:05:38 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 kb |
#include<fstream>
#include<string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main ()
{
char text[1000];
f.get(text,100);
char car[]=" ,!?.";
int nrcuv=0,litere=0;
int n=strlen(text);
for(int i=0;i<n;i++)
{
if (strchr(" ",text[i]))
nrcuv++;
if(strchr("-",text[i]))
nrcuv++;
if(isalpha(text[i]))
litere++;
}
g<<litere/(nrcuv-1);
return 0;
}
