Pagini recente » Cod sursa (job #1665800) | Cod sursa (job #2981741) | Cod sursa (job #2733760) | Cod sursa (job #390274) | Cod sursa (job #1338734)
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
using namespace std;
int main(){
ifstream in("text.in");
ofstream out("text.out");
string when;
int db = 1;
int ossz = 0;
getline(in,when);
for(int i = 0;i<when.length();i++){
if((when[i] == '-' or when[i] == ' ' or when[i] == '.' or when[i] == '!' or when[i] == '?' ) and when[i+2] != ' '){
db++;
}
if(when[i] == '!' or when[i] == '.' or when[i] == '.' or when[i] == ':' or when[i] == '?' or when[i] == '/'){
ossz--;
}
}
ossz += when.length()-db;
cout << ossz/db;
cout << endl << db << endl << ossz;
return 0;
}