Cod sursa(job #1780822)
Utilizator | Data | 16 octombrie 2016 16:08:24 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | simulare_emag_mediu_2016_runda1 | Marime | 0.52 kb |
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char ch;
int litera = 0, cuvant = 0,ok=1;
while (f >> noskipws >> ch)
{
if(isalpha(ch))
{
litera++;
ok=0;
}
else if(ok==0)
{
cuvant++;
ok=1;
//cout<<litera<<' '<<cuvant<<'\n';
}
}
///cout<<cuvant;
g<<litera/cuvant;
}