Cod sursa(job #1388204)
Utilizator | Data | 15 martie 2015 12:01:50 | |
---|---|---|---|
Problema | Text | Scor | 80 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include<fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int nr,nr1;
char c;
int main()
{fin>>c;
nr=0;
while(fin.get(c))
{if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{nr++;
while(fin.get(c) && c != '\n' && (c >= 'A' && c<='Z') || (c >= 'a' && c <= 'z'))
nr++;
nr1++;}}
fout<<nr/nr1;
return 0;
}