Cod sursa(job #1448570)
| Utilizator | Data | 7 iunie 2015 15:02:31 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
int kca, kcu; char c;
int litera()
{
return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
}
int main()
{
do c = f.get(); while ( !litera() );
while (c != -1)
{
while ( litera() )
{
kca++;
c = f.get();
}
kcu++;
while ( !litera() && c != -1) c = f.get();
}
g << kca / kcu;
g.close(); return 0;
}
