Cod sursa(job #968048)
Utilizator | Data | 30 iunie 2013 17:43:35 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<fstream>
using namespace std;
int main()
{
ifstream f;
ofstream g;
f.open("text.in");
g.open("text.out");
int i,n=0,m=0;
char a[256],x=0;
f.get(a,'n');
for(i=0; i<=strlen(a); i++)
{
if ((int(toupper(a[i]))>=65) and (int(toupper(a[i]))<=90))
{
x++;
}
else
{
if ((int(toupper(a[i-1]))>=65) and (int(toupper(a[i-1]))<=90))
{
n++;
m=m+x;
x=0;
}
}
}
g<<m/n;
f.close();
g.close();
return 0;
}