Cod sursa(job #1516789)
| Utilizator | Data | 3 noiembrie 2015 16:22:23 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s[1000005];
int main()
{
int cnt=0,lun=0,i;
fin.getline(s,1000000);
for(i=0;s[i+1]!=0;i++)
{
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')) lun++;
else if ((s[i]<'a'||s[i]>'z'||s[i]<'A'||s[i]>'Z')&&((s[i+1]>='a'&&s[i+1]<='z')||(s[i+1]>='A'&&s[i+1]<='Z'))) cnt++;
}
fout<<lun/cnt<<"\n";
return 0;
}
