Cod sursa(job #1830545)
| Utilizator | Data | 16 decembrie 2016 20:28:23 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#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;
}
