Cod sursa(job #1830539)
| Utilizator | Data | 16 decembrie 2016 20:24:11 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.57 kb |
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main(){
ifstream f("flip.in");
ofstream g("flip.out");
string text;
f >> text;
text = "- Lasa-ma in pace, ca am invatat azi noapte toata ziua!";
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;
}
