Pagini recente » Cod sursa (job #2738807) | Istoria paginii runda/g6c2h7e4f5c2h7b1c2 | Cod sursa (job #1336651) | Cod sursa (job #694948) | Cod sursa (job #2443650)
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char text[256];
int nrCuv, nrLitere;
int main() {
while(!f.eof()) {
f.getline(text, 255);
for(unsigned int i = 0; i < strlen(text); i++)
if(isalpha(text[i])) {
nrLitere++;
if(!isalpha(text[i-1]) || i == 0)
nrCuv++;
}
}
g << nrLitere / nrCuv;
}