编写交换两个变量值的函数,并调用该函数交换主函数中两个变量的值

学习 时间:2026-09-27 16:36:14 阅读:3547
编写交换两个变量值的函数,并调用该函数交换主函数中两个变量的值C表示

最佳回答

柔弱的白猫

着急的小熊猫

2026-09-27 16:36:14

#includevoid fun(int *a,int *b){int temp ;temp = *a ;*a = *b ;*b = temp ; }main(){int a=1;int b=2;fun(&a,&b);printf("a=%d,b=%d",a,b);}

最新回答共有2条回答

  • 现代的钢笔
    回复
    2026-09-27 16:36:14

    #includevoid fun(int *a,int *b){int temp ;temp = *a ;*a = *b ;*b = temp ; }main(){int a=1;int b=2;fun(&a,&b);printf("a=%d,b=%d",a,b);}

上一篇 Can you make a cake or not?如何回答

下一篇 [-B35] Today we'll talk about a great many cases ------ begi