程序代码:
#include<iostream> int main() { int a[4] { 4,-3, 2, -5 }; for (int i = 0; i != 4; ++i) { int c,tem = a[i]; c = tem < 0 ? 1 : -1; for (; tem; tem += c) std::cout << tem << ' '; std::cout << "0 "; } std::cout << std::endl; }
[此贴子已经被作者于2020-2-2 17:47编辑过]
能编个毛线衣吗?