请教如何⽤c语⾔去除⼀个数组中所有值为零的元素,⽽且这些零元素中有连续排列的?
能否给⼀个⽰例程序?感激不尽!
⽐如以下这个数组中有连续的0元素,如何去除所有的零元素?
double a[64]={4.63866e+020,1.456e+027,-7.67487e+017,9.86481e+016,0,0,-3.1101e+014,-9.38282e+010,
1.456e+027,4.60249e+033,-
2.3969e+024,
3.36857e+023,0,0,-9.64264e+020,-2.93898e+017,
-7.67487e+017,-2.3969e+024,1.27445e+015,-1.52231e+014,0,0,5.19276e+011,1.55469e+008,
令数组全部的值为09.86481e+016,3.36857e+023,-1.52231e+014,1.02833e+014,0,0,-4.00459e+010,-2.01495e+007,
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
-3.1101e+014,-9.64264e+020,5.19276e+011,-4.00459e+010,0,0,2.17304e+008,62943,
-9.38282e+010,-2.93898e+017,1.55469e+008,-2.01495e+007,0,0,62943,19};
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论