Pagini recente » miculstring | Cod sursa (job #1714881) | Cod sursa (job #2574392) | Monitorul de evaluare | Cod sursa (job #1830545)
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main(){
ifstream f("text.in");
ofstream g("text.out");
string text;
f >> text;
int space = 0, x=0;
for(int i=0;i<text.size();i++){
if(text[i] == ' ')
space++;
if(!isalpha(text[i]) && text[i] != ' ')
x++;
}
int z = text.size() - space - x;
int y = space+1;
g << z / y;
f.close();
g.close();
return 0;
}