Cod sursa(job #1284607)
| Utilizator | Data | 6 decembrie 2014 17:28:32 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include<fstream>
#include<cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int n,c,l,i,k;//nr de cuvinte/nr de litere
char a[2];
unsigned char ch;
int main()
{
l=0;c=0;k=0;
while(fin.get(a,2))
{
ch=a[0];
if(ch>='a'&& ch<='z')ch=ch-32;
if(ch<'A'|| ch>'Z'){k=0;}
else
{
l++;
if(k==0){c++; k=1;}
}
}
fout<<l/c;
fin.close();
fout.close();
return 0;
}
