摘要: 实现一维动态数组 include include<malloc.h> using namespace std; void output(int n) { int* arr = (int*)malloc(sizeof(int) * n);//在c++中,则是int * arr = new int[n] 阅读全文
posted @ 2024-10-26 22:27 韦旋 阅读(15) 评论(0) 推荐(0)
摘要: 这是三个不同的方法,这三个代码优点从低到高越来越明显 include using namespace std; int main() { double n; cin >> n; if (n <= 100) cout << (float)n << endl; else if (n >= 100 && 阅读全文
posted @ 2024-10-20 09:33 韦旋 阅读(14) 评论(0) 推荐(0)