Cod sursa(job #1529320)
Utilizator | Data | 20 noiembrie 2015 19:22:31 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <iostream>
#include <fstream>
using namespace std;
bool k=false;
string s;
int x,i,n,q;
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]>='A' and s[i]<='Z') or (s[i]>='a' and s[i]<='z'))
{
x++;
k=false;
}
else
if(k==false and x>0)
{
q++;
k=true;
}
}
g<<x/q;
return 0;
}