Cod sursa(job #1288757)
Utilizator | Data | 9 decembrie 2014 01:29:16 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
//http://www.infoarena.ro/problema/text
#include <fstream>
#include <cstring>
#include <string>
using namespace std;
int main(){
char c;
int lung=0,ok,y=0,k=0;
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
f.get(c);
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
lung++;
if(k==0)
y++;
k=1;
}
else
k=0;
}
g<<(int)lung/y;
return 0;
}