#include
#include
#include
void fun(int a,int b,long *c)
{
int a1,a2,b1,b2; /*分别存放a数十位,a数个位,b数十位,b数个位的数字*/
a1 = a/10;
a2 = a%10;
b1 = b/10;
b2 = b%10;
*c = a1 * 1000 + b2 * 100 + a2 * 10 + b1; /*数字按要求组合,存入c*/
}
main()
{
int a,b;
long c=0;
system("cls");
printf("Input a,b:");
scanf("%d%d",&a,&b);
fun(a,b,&c);
printf("The result is:%ldn",c);
return 0;
}
vc++ 6.0 成功运行