Cod sursa(job #1557472)
Utilizator | Data | 27 decembrie 2015 16:29:20 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.65 kb |
#include <iostream>
#include <fstream>
using namespace std;
int x=0,y=0,n,i;
string s;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
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++;
else
{
while(!((s[i]>='A' and s[i]<='Z')or (s[i]>='a' and s[i]<='z')))
i++;
i--;
y++;
}
}
s.erase(0,n-1);
}
g<<x/y;
return 0;
}