Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Untitled
SUBMITTED BY:
Guest
DATE:
Sept. 30, 2014, 10:19 p.m.
FORMAT:
Text only
SIZE:
610 Bytes
Raw
Download
Tweet
HITS:
1239
Go to comments
Report
char letter='0';
int openab=0;
int openabnoc=0;
int openacb=0;
int sumab=0;
int sumabnoc=0;
int sumacb=0;
int i;
scanf("%c",&letter);
while(letter!='.')
{
if(letter=='a')
{
openab++;
openabnoc++;
}
if(letter=='c'&&openabnoc!=0)
{
openabnoc--;
openacb++;
}
if(letter=='b'&&openabnoc!=0)
{
sumabnoc++;
}
if(letter=='b'&&openab!=0)
{
for(i=1;i<=openab;i++)
{
sumab++;
}
}
if(letter=='b'&&openacb!=0)
{
sumacb++;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus