Cod sursa(job #818842)
Utilizator | Data | 18 noiembrie 2012 09:27:12 | |
---|---|---|---|
Problema | Text | Scor | 30 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
char s[1000];
int i,c=1,d=0;
float x;
ifstream f("text.in");
ofstream g("text.out");
f.get(s,100);
for(i=0;i<strlen(s);i++)
if(s[i]==' ')
c++;
else
if(strchr("abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s[i])!=NULL)
d++;
g<<d/c;
return 0;
}