用C语言给定两个整形变量的值,将两个值的内容进行交换1。

#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>

int main()

{    
 int a, b;
    int tmp = 0;  
    scanf("%d%d",&a,&b);  
  printf("a = %d b = %d\n", a, b); 
    tmp = a;  
   a = b;  
   b = tmp;  
 printf("a = %d b = %d\n", a, b);
 system("pause");
  return 0;
}

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Richchigga/article/details/88711048