Cod sursa(job #1576407)
Utilizator | Data | 22 ianuarie 2016 13:48:29 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
using namespace std;
string s;
long long w,l,n,i,k=0,c;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
getline (f,s);
n=s.length();
for (i=0;i<=n-1;i++)
{
if (isalpha(s[i])) l++;
else if (isalpha(s[i+1])) c++;
}
if (isalpha(s[0])) c++;
g<<l/c;
return 0;
}