題目:專升本一題,讀結果,
程式分析:無,
程式源代碼:
1 #include<stdio.h> 2 #include<stdlib.h> 3 4 #define M 5 5 int main() 6 { 7 int a[M]={1,2,3,4,5}; 8 int i,j,t; 9 i=0;j=M-1; 10 while(i<j) 11 { 12 t=*(a+i); 13 *(a+i)=*(a+j); 14 *(a+j)=t; 15 i++;j--; 16 } 17 for(i=0;i<M;i++) { 18 printf("%d\n",*(a+i)); 19 } 20 21 }
以上實體運行輸出結果為:
5 4 3 2 1
感謝你的閱讀,請用心感悟!希望可以幫到愛學習的你!!分享也是一種快樂!!!請接力,,,
點擊查看原文,謝謝!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/1867.html
標籤:C
上一篇:C 實戰練習題目89
下一篇:C 實戰練習題目91
