<commit_before>#include <stdlib.h>
#include <stdio.h>
#include <errno.h>

void shift(int* line);

int main(void)
{
	errno=0;
	int line[4];

	while(errno==0)
	{
		scanf("%d-%d-%d-%d", line, line+1, line+2, line+3);
		shift(line);
		printf("%d-%d-%d-%d\n",line[0], line[1], line[2], line[3]);
	}
	return 0;
}

void shift(int* line)
{
	int i, j;

	for(i=0;i<=2;i++)
		for(j=i+1;j<=3;j++)
		{
			if(line[i]==line[i+1]&&line[i]!=0)
				line[i]+=line[i+1], line[i+1]=0;
			if(line[i]==0&&line[j]!=0)
				line[i]=line[j], line[j]=0;
		}<commit_msg>Wrote a working and (more or less) simple shifting algorithm.<commit_after>#include <stdlib.h>
#include <stdio.h>
#include <errno.h>

#define FLDSIZE 4

void shift(int* line);

int main(void)
{
	errno=0;
	int line[4];

	while(errno==0)
	{
		scanf("%d-%d-%d-%d", line, line+1, line+2, line+3);
		shift(line);
		printf("%d-%d-%d-%d\n",line[0], line[1], line[2], line[3]);
	}
	return 0;
}

void shift(int* line)
{
	int i,j;

	for(i=0;i<=FLDSIZE-2;i++)
		for(j=i+1;j<=FLDSIZE-1;j++)
			if(line[i]==line[j])
			{
				line[i]+=line[j], line[j]=0;
				break;
			}
			else if(line[j]!=0||line[i]==0)
				break;
	for(i=-1;i<=FLDSIZE-2;i++)
		for(j=i+1;j<=FLDSIZE-1&&line[i+1]==0;j++)
			if(line[j]!=0)
			{
				line[i+1]=line[j];line[j]=0;
				break;
			}
{'fraction_non_alphanumeric': 0.2766122766122766, 'fraction_numerical': 0.039627039627039624, 'mean_word_length': 4.257142857142857, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4448874', 'n_tokens_mistral': 711, 'n_tokens_neox': 644, 'n_words': 99}