Cod sursa(job #1821490)
Utilizator | Data | 3 decembrie 2016 11:16:40 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | x_test2 | Marime | 0.56 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int i,k,m,nr,n,ok;
char simb[110],s[11000000],*p,cuv[11000000],vec[]="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
int main()
{
f.getline(s,1100000);
n=strlen(s);
m=0;
nr=0;
for(i=0;i<n;i++){
if(strchr(vec,s[i])==0){
if(ok==1){
nr++;
ok=0;
}
}
else{
m++;ok=1;
}
}
if(nr>0)g<<m/nr;
else g<<0;
}