Cod sursa(job #1773716)
| Utilizator | Data | 8 octombrie 2016 09:47:31 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
using namespace std;
int n,i,cuv,nr;
string s;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
getline(f,s);
n=s.size();
for(i=0;i<n;i++)
{
if(((s[i]<='z')&&(s[i]>='a'))||((s[i]<='Z')&&(s[i]>='A')))
{cuv++;
while((((s[i]<='z')&&(s[i]>='a'))||((s[i]<='Z')&&(s[i]>='A')))&&(i<n))
{
nr++;
i++;
}}
}
if(cuv>0)g<<nr/cuv;
else g<<cuv;
return 0;
}
