<commit_before>#include <stdio.h>
#include <string.h>

int takeDigits(char a[], int nums[]);
int check_result(unsigned int len, int nums[]);
int result;

int main(){
	char a[10];
	// int check = 0;
	scanf("%s",a);
	scanf("%d",&result);
	unsigned int len = strlen(a);
	int nums[len * 2];
	takeDigits(a,nums);
	permute(nums,0,len);
	// do{
	// 	for(int i = 0;i < strlen(a); i++){
	// 		for(int k = 0;k < strlen(a);k++){

	// 		}
	// 	}
	// }while(check != result);
}

int takeDigits(char a[], int nums[]){
	for(unsigned int i= 0; i< strlen(a); i++){
		nums[i] = a[i] -'0';
 	}
 	for(unsigned int i= strlen(a); i < 2 * strlen(a); i++){
		nums[i] = a[i] -'0' * (-1);
 	}
}

void permute(int array[],int i, int len){
	if(len == i){
		return -1;
	}else{
		int j = i;
		for(j = i; j < len * 2;j++){
			int swap = array[i];
			array[i] = array[j];
			array[j] = swap;
			check_result(len,array);
			permute(array,i+1,len);
			// printf("KAKA\n");
			// break;
		}
	}
}

int check_result(unsigned int len, int nums[]){
	for(int i = 0; i < len; i++){
		for(int k = i; k < len; k++){
			if(nums[i] == -1 * nums[k] || nums[k] == -1 * nums[i]){
				return 0;
			}
		}
	}
	int check = 0;
	for(int i = 0; i < len;i++){
		check+= nums[i];
		printf("s %d\n",check);

		break;
	}
	if (check == result){
		for (int i = 0; i < len; ++i)
		{
			if(i = 0 && nums[i] > 0){
				printf("%d ",nums[i] );
			}else if(nums[0] < 0){
				return;
			}
			if(nums[i] > 0){
				printf( "+ %d",nums[i]);
			}else{
				printf("- %d",nums[i]);
			}
		}
	}
}<commit_msg>Task3.c Finished Finaly<commit_after>#include <stdio.h>
#include <string.h>


void printer(int array[], int len, int sum);
int check_sum(int array[], int sum, int position, int len);
int array_sum(int array[], int len);
int result_ans = 1;

int main(){
	char input[10];
	int sum;
	scanf("%s",input);
	scanf("%d", &sum);
	int intput[strlen(input)];
	for(unsigned int i = 0; i < strlen(input);i++){
		intput[i] = input[i] - '0';
	}
	check_sum(intput, sum, 1, strlen(input));
	if(result_ans){
		printf("-1");
	}
	return 0;
}


int check_sum(int array[], int sum, int position, int len){
	if(position >= len){
		return 0;
	}
	int flag = 0;
	int cur_rotation[len];
	//COPY
	for(int i = 0; i < len; i++){
		cur_rotation[i] = array[i];
	}


	for(int i = 0; i < 2; i++){
		if(i != 0){
			array[position] *= -1;			
		}
		// printf("%d %d %d\n",array[0],array[1],array[2] );
		// CHECK FOR COPY
		for(int k = 0; k < len; k++){
			if(cur_rotation[k] != array[k]){
				flag = 1;
			}
		}
		if(flag){	
			if(array_sum(array, len) == sum){
				printer(array, len, sum);
			}
			check_sum(array, sum, position + 1,len);
		}else{
			check_sum(array, sum, position + 1,len);			
		}
	}
}

int array_sum(int array[], int len){
	int sum = 0;
	for(int i = 0; i < len; i++){
		sum += array[i];
	}
	return sum;
}

void printer(int array[], int len, int sum){
	printf("%d",array[0]);
	for(int i = 1;i < len; i++){
		if(array[i] > 0){
			printf("+");
			printf("%d", array[i]);
		}else{
			printf("%d", array[i]);
		}
	}
	printf("=%d",sum);
	result_ans = 0;
}
{'fraction_non_alphanumeric': 0.23508314313661557, 'fraction_numerical': 0.018258884903814804, 'mean_word_length': 3.0689655172413794, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 11, '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': '5652297', 'n_tokens_mistral': 1517, 'n_tokens_neox': 1370, 'n_words': 339}