Cod sursa(job #1200870)
| Utilizator | Data | 23 iunie 2014 19:05:21 | |
|---|---|---|---|
| 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 main()
{
c=f.get();
while (!(('a'<=c && c<='z') || ('A'<=c && c<='Z')))
c=f.get();
while (c!=-1)
{
while (('a'<=c && c<='z') || ('A'<=c && c<='Z'))
{
kca++;
c=f.get();
}
if (!(('a'<=c && c<='z') || ('A'<=c && c<='Z')))
kcu++;
while ((!(('a'<=c && c<='z') || ('A'<=c && c<='Z'))) && c!=-1)
c=f.get();
}
g<<kca/kcu;
g.close();
return 0;
}
