Cod sursa(job #1895263)
Utilizator | Data | 27 februarie 2017 21:05:49 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
long long n,s,k;
bool ok;
char ch;
int main()
{
while(f.get(ch))
{
if((ch>='a' && ch<='z') || (ch>='A' && ch<='Z'))
{
s++;
ok=1;
}
else
{
if(ok)
{
k++;
ok=0;
}
}
}
g<<s/k;
}