[ create a new paste ] login | about

Link: http://codepad.org/obWxxx5R    [ raw code | output | fork ]

C++, pasted on Nov 25:
#include <stdio.h>
#include <stdlib.h>

#define N 20

int main(int argc, char* argv[])
{
	char str[256] = "1100000011111110000111111000001111110001011111111111\0";

	printf("%s\n",str);

	for (int i = 0; str[i] != '\0'; i++)
	{
		int k = i;
		while (str[i] == str[i+1]) i++;

		if ((abs(k-i) % 2))
		{
			for (int t = k; t <= i; t++)
				printf("%c", str[t]);

			printf("\n");
		}
	}

	return 0;
}


Output:
1
2
3
4
5
6
1100000011111110000111111000001111110001011111111111
11
000000
0000
111111
111111


Create a new paste based on this one


Comments: