266A:Stones on the table

Problem Link


<Source Code>

#include<stdio.h>
#include<string.h>
int main()
{
char a[10000],pr,b[10000];
long sum=0,i,l,content=0,length;
scanf(“%ld”,&l);
{getchar();
sum=0;for(i=0;i<l;i++)
scanf(“%c”,&a[i])
;length=strlen(a);
pr=a[content];
while(content++<length)
{if(a[content]==pr)
sum++;
else
pr=a[content];
}
printf(“%lld\n”,sum);
}return 0;
}

Advertisements

About waprogramming

I am in CSE,from CUET
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s