Cod sursa(job #1687144)

Utilizator DaniellDa Vinci Daniell Data 12 aprilie 2016 18:14:47
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.57 kb
#include <fstream>
#include <string>

using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

int s,c,i,ii;
char v[100000000];

void Read()
{fin.getline(v,100000000);
for(ii=1;ii<=100000000,v[ii];ii++);
}
void Rezolva()
{for(i=1;i<=ii;i++)
{if((v[i]>'z' || v[i]<'a' )&&( v[i]>'Z' || v[i]<'A'))
    {if( (v[i-1]<='z' && v[i-1]>='a') || (v[i-1]<='Z' && v[i-1]>='A'))
    c++;}
else if( (v[i]<='z' && v[i]>='a') || (v[i]<='Z' && v[i]>='A'))
    s++;
}

}
int main()
{Read();
Rezolva();
if(c!=0)fout<<s/c;
else fout<<0;
    return 0;
}