Cod sursa(job #1661403)
| Utilizator | Data | 23 martie 2016 20:46:52 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main ()
{
ifstream fin ("text.in");
ofstream fout ("text.out");
string str;
int nrca=0,nrcu=0;
while (!fin.eof()){
fin>>str;
//<<"str:"<<str<<"\n";
int n=str.length();
////<<"str:"<<str<<"\n";
char c;
//<< " n="<<n;
for (int i=0;i<n;++i)
{
c=str[i];
if ((65 <= c && 90>=c) || (97 <= c && 122>=c))
{
nrca++;
}
}
nrcu++;
}
nrca/=nrcu;
fout<<nrca;
}
