原创 幾組容易混淆的代碼

一、幾個交換兩個數a,b的算法:void swap(int*m,int*n) {  int *t=0;  t=m;m=n;n=t;   /* 傳過來的a,b的地址被賦給臨時變量m,n,該函數只是對臨時變量的交換,對a,b,pa,pb無影響 

原创 指針與指向指針的指針

#include<stdio.h> #include<malloc.h> typedef struct {   int loc; }stc; void alterInfo(stc*s) {   s=(stc*)malloc(sizeof(s

原创 Leetcode 307. Range Sum Query - Mutable

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.The update(i, val)

原创 C語言實現大整數減法

在北京航空航天大學出版社出版的丁海軍老師主編的《程序設計基礎(C語言)》第236頁,我看到了一個大整數減法的的算法實現,試驗了這樣一組數據:as="99999";bs="100004";結果:rs=-1&1&5請按任意鍵繼續. . .多次調