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

📄 hamso.c

📁 Many C samples. It is a good sample for students to learn C language.
💻 C
字号:
/* Bai tap 2_13 - Chuong trinh ve duong ham so y = sin(x) */
#include <conio.h>
#include <graphics.h>
#include <math.h>

/* he so doi tu do sang radian */
#define RADS 0.017453293
#define K 100

void ham1()
{
   double xmax, yc, x = 0.0, y;

   xmax = getmaxx();
   yc = getmaxy() / 2;
   while (x<xmax)
   {
      y = K * sin(x * RADS);
      putpixel(x, yc + y, YELLOW);
      x += 0.1;
   }
}

void main()
{
  int gr_drive = DETECT, gr_mode;
  double a, b, n;

  initgraph(&gr_drive, &gr_mode, "");
  ham1();
  getch();
  closegraph();
}

⌨️ 快捷键说明

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