Pagini recente » Cod sursa (job #1717556) | Cod sursa (job #576615) | Cod sursa (job #2970991) | Borderou de evaluare (job #1283485) | Cod sursa (job #921216)
Cod sursa(job #921216)
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main() {
char c[1024];
long st,sct;
bool aux;
st=sct=0;
f>>c;
while(!f.eof()) {
long s=0;
aux=0;
for(long i=0;i<strlen(c);i++)
if((c[i]>='a'&&c[i]<='z')||(c[i]>='A'&&c[i]<='Z')) {
s++;
if(!aux)
sct++;
aux=1;
} else
aux=0;
st+=s;
//if(s)
// sct++;
f>>c;
}
g<<st/sct;
}