Cod sursa(job #1427012)
Utilizator | Data | 1 mai 2015 12:16:55 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<fstream>
#include<cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int nr,con;
char x,y='-';
int main()
{
while(!f.eof())
{
f.get(x);
if(x>='a'&&x<='z'||x>='A'&&x<='Z')
nr++;
else if(y>='a'&&y<='z'||y>='A'&&y<='Z')
con++;
y=x;
}
g<<nr/con;
return 0;
}