Cod sursa(job #1438281)
Utilizator | Data | 19 mai 2015 15:45:10 | |
---|---|---|---|
Problema | Text | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
string s;
int cuv=0,sum=0;
while(f>>s)
{
if(s.find("-")!=std::string::npos||s.find("'")!=std::string::npos||s.find(",")!=std::string::npos){cuv++;}
cuv++;
sum+=s.length();
}
g<<sum/cuv;
return 0;
}