Pagini recente » Cod sursa (job #3178457) | Cod sursa (job #2714072) | Cod sursa (job #2195611) | Cod sursa (job #2626170) | Cod sursa (job #2328460)
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char text[200];
int main()
{
int n=0,l=0,i;
f.get(text, 200);
for(i=0; i<strlen(text);)
if((text[i]>='a' and text[i]<='z') or (text[i]>='A' and text[i]<='Z')){
n++;
while((text[i]>='a' and text[i]<='z') or (text[i]>='A' and text[i]<='Z'))
l++,i++;
}
else i++;
g<<l/n;
return 0;
}