Pagini recente » Istoria paginii utilizator/problema_tablete | Istoria paginii utilizator/andreigatea | Return of the MVC | Diferente pentru problema/calandrinon intre reviziile 6 si 11 | Cod sursa (job #2157081)
#include <fstream>
#include <iostream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main(){
string s;
int c = 0, l = 0, i = 0, isword = 0;
getline(in, s);
out << s << endl;
while(i < s.size()){
if((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z')){
l++;
if(isword == 0){
isword = 1;
c++;
}
}
else{
isword = 0;
}
i++;
}
out << l << endl << c << endl << l / c;
}