Cod sursa(job #1819041)
Utilizator | Data | 30 noiembrie 2016 01:52:59 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
long long i,j,n,sum=0,k=0;
int ok=0;
string s;
char c;
int main()
{
while(!f.eof())
{
f.get(c);
if((c>='A' && c<='Z') || (c>='a' && c<='z'))
{
if(ok==0)
{
ok=1;
k++;
}
sum++;
}
else
ok=0;
}
if(k!=0)
g<<sum/k;
}