rs_main.c

来自「(31,25)RS码编码以及解码的C程序」· C语言 代码 · 共 51 行

C
51
字号
#include "stdio.h"
#include "math.h"

#include "RSHeader_encode.h"
#include "RSHeader_decode.h"


void main()
{
	int temp_rec[31]={24,28,14,5,26,23,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,23,22,23,24,13};
	int i;
	printf("The data before encode is \n");
	for(i=0;i<25;i++)
	{
		temp_Bencode[i]=i+1;
		printf("%d ",temp_Bencode[i]);
	}
	printf("\n");	

	encode();

	printf("The data after encode is \n");
	for(i=0;i<31;i++)
	{
		printf("%d ",temp_Aencode[i]);
	}
	printf("\n");


	
	printf("The data received is \n");
	for(i=0;i<31;i++)
	{
		printf("%d ",temp_rec[i]);
	}
	printf("\n");
	/*the part of decode*/
	assignValue(temp_Bdecode,temp_rec,31);
	decode();



	printf("the data after decode is \n");
	for(i=0;i<25;i++)
	{
		printf("%d ",temp_Adecode[i]);
	}	
	printf("\n");
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?