Cod sursa(job #1448556)
Utilizator | Ginga Tudor-Adrian JustGinga | Data | 7 iunie 2015 14:30:19 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.55 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()
{
c = f.get();
while (!litera())
c=f.get();
while (c!=-1)
{
while (litera())
{
kca++;
c=f.get();
}
if (!litera())
kcu++;
while ((!litera()) && c!=-1)
c=f.get();
}
g<<kca/kcu;
g.close();
return 0;
}