Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  good
Language: C/C++
Code:
#include <stdio.h>
main()
{
  int i,op,ca=0,cb=0,cc=0,cd=0,ce,cf,cg,ch,ci,cj,ck,cl,cm,cn,co,cp,cq,cr,cs,ct,
cu,cv,cw,cx,cy,cz;
int coa=0,cob=0,coc=0,cod=0,coe,cof,cog,coh,coi,coj,cok,col,com,con,coo,cop,coq,cor,cos,cot,
cou,cov,cow,cox,coy,coz,tc,toc; 
char str[100];
scanf("%s",str);
for(i=0;i<4;i++);
{
if(str[i]='a')
{
    ca=1;
}else
if(str[i]='b')
{cb=2;
}else
if(str[i]='c')
{cc=3;
}else
if(str[i]='d')
{cd=4;
}

}

for(i=0;i<=4;i++)
{
    if(str[i]='a')
    {
        coa++;
}
else if(str[i]='b')
{cob++;
}else if(str[i]='c')
{coc++;
}else if(str[i]='d')
{cod++;
}}
tc= ca+cb+cc+cd;
toc= coa+coc+cob+cod;
op=tc-toc;
printf("%d",op);
}
          
Comments: