Cod sursa(job #1228004)
Utilizator | Data | 12 septembrie 2014 14:59:24 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <fstream>
#include <stdio.h>
using namespace std;
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char c;
int nrlit=0,nrcuv=1,rez=0;
while(c!=EOF){
c=fin.get();
if((c>='a' && c<='z') || (c>='A' && c<='Z'))
nrlit++;
else if ((c==32) || (c==45))
nrcuv++;
}
rez=nrlit/(nrcuv);
fout<<rez;
return 0;
}