伪码:
REVERSE(i, a, temp)//数组逆序输出//
1.for i from 0 to 4, step (+1)
2.output a[i] //正序输出数组a[N]//
3.for i from 0 to 2, step (+1)
4.{ temp<-a[i]; a[i]<-a[4-i]; a[4-i]<-temp; }
5.for i from 0 to 4, step (+1)
6.output a[i] //倒序输出数组a[N]//
7.return
伪码:
REVERSE(i, a, temp)//数组逆序输出//
1.for i from 0 to 4, step (+1)
2.output a[i] //正序输出数组a[N]//
3.for i from 0 to 2, step (+1)
4.{ temp<-a[i]; a[i]<-a[4-i]; a[4-i]<-temp; }
5.for i from 0 to 4, step (+1)
6.output a[i] //倒序输出数组a[N]//
7.return