Cod sursa(job #2657436)
Utilizator | Data | 10 octombrie 2020 16:05:31 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <iostream>
#include <fstream>
using namespace std;
int o,n,c;
char a;
int main()
{
ifstream f ("text.in");
ofstream g ("text.out");
while (f.get(a))
{
if ('A'<=a && a<='Z')
{
n++;
o=1;
}
else if ('a'<=a && a<='z')
{
n++;
o=1;
}
else
{
if (o==1) {c++;o=0;}
}
}
if (o==1)
{
c++;
o=0;
}
g<<n/c;
}