精品久久免费视频,国产在线99,欧美伊人久久综合网,99欧美在线,久久伊人成人网,青青国产成人久久激情91麻豆,h黄视频在线观看

設(shè)置一個(gè)臨時(shí)變量交換兩個(gè)變量的值 -電腦資料

電腦資料 時(shí)間:2019-01-01 我要投稿
【www.cfdfis.com - 電腦資料】

     當(dāng)要交換兩個(gè)數(shù)的值時(shí),通常的做法是定義一個(gè)臨時(shí)變量,然后再進(jìn)行交換,

設(shè)置一個(gè)臨時(shí)變量交換兩個(gè)變量的值

。

    C語言代碼如下:

   

# include <stdio.h>int main(){   int a, b;   int *p;    //臨時(shí)變量       scanf("%d %d", &a, &b);       p = a;   a = b;   b = p;       printf("交換后的值為:");   printf("%d %d\n", a, b);   return 0;}

最新文章