⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 print_array.h

📁 这是数学计算上常用的计算方法
💻 H
字号:
#ifndef _PRINT_ARR_
#define _PRINT_ARR_

#include <iostream>
#include <iomanip>
#include "nrutil.h"
using namespace std;

template<class T>
void print_array(const NRVec<T> &a, const int n_per_row, const int col_width)
{
	int i,j=0;

	int n_elements=a.size();
	for (i=0; i < n_elements; i++) {
		if (j == n_per_row) {
			cout << endl;
			j=0;
		}
		cout << setw(col_width) << a[i];
		j++;
	}
	cout << endl;
}

#endif /* _PRINT_ARR_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -