Cod sursa(job #1388220)
Utilizator | Data | 15 martie 2015 12:08:57 | |
---|---|---|---|
Problema | Text | Scor | 50 |
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 main()
{int nr=0,nr1=0;
char c;
fin>>c;
while(fin.get(c))
{if((c>='A'&&c<='Z')||(c>='a'&&c<='a'))
{nr++;
while(fin.get(c) && c != '\n' && (c >= 'A' && c<='Z') || (c >= 'a' && c <= 'z'))
nr++;
nr1++;}}
fout<<nr/nr1;
return 0;
}