函数fun的功能是:将a、b中的两个两位整数合并形成一个新的整数放在c中。合并的方式是:将a中的十位和个位数依次放在变量c的十位和千位上,b中的十位和个位数依次放在变量c的个位和百位上。
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
void fun(int a, int b, long *c)
{
*c = a / 10 * 10 + a % 10 * 1000 + b / 10 + b % 10 * 100;
}
int main()
{
int a, b;
long c;
printf("Input a,b:");
scanf("%d%d", &a, &b);
fun(a, b, &c);
printf("The result is: %ld\n", c);
system("pause");
return 0;
}