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

📄 histogram.c

📁 该文件为c++的数学函数库!是一个非常有用的编程工具.它含有各种数学函数,为科学计算、工程应用等程序编写提供方便!
💻 C
字号:
#include <stdio.h>#include <stdlib.h>#include <gsl/gsl_histogram.h>intmain (int argc, char **argv){  double a, b;  size_t n;  if (argc != 4)    {      printf ("Usage: gsl-histogram xmin xmax n\n"              "Computes a histogram of the data "              "on stdin using n bins from xmin "              "to xmax\n");      exit (0);    }  a = atof (argv[1]);  b = atof (argv[2]);  n = atoi (argv[3]);  {    double x;    gsl_histogram * h = gsl_histogram_alloc (n);                gsl_histogram_set_ranges_uniform (h, a, b);    while (fscanf (stdin, "%lg", &x) == 1)      {        gsl_histogram_increment (h, x);      }    gsl_histogram_fprintf (stdout, h, "%g", "%g");    gsl_histogram_free (h);  }    exit (0);}

⌨️ 快捷键说明

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