Pagini recente » Cod sursa (job #760136) | Cod sursa (job #1474700) | Rating State Mihai (StateMihai05) | Cod sursa (job #2955863) | Cod sursa (job #1824918)
#include <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <fstream>
using namespace std;
int medlc(string s) {
string w;
int c=0,l=0;
for (int i = 0; i < s.size(); i++)
{
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
{
l++;
if((s[i+1]<'A'&&s[i+1]>'a')||(s[i+1]<'Z'||s[i+1]>'z')){c++;}
}
}
return l/c ;
}
int main() {
ifstream t1("text.in");
ofstream t2("text.out");
string s;
getline(t1,s);
t2<<medlc(s);
}