c代码:

// Test1.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <stdio.h> #include <math.h> #define PAI 3.1415926 int main(void) { double x,y; for(y=-1;y <=1;y=y+0.1) { for(x=-PAI;x <=PAI;x=x+0.1) { if(fabs(y-sin(x)) <=0.046) printf("~"); else printf(" "); } printf("\n"); } getchar(); return 0; }

效果:

控制台输出正弦曲线

相关文章:

  • 2021-11-03
  • 2021-06-13
  • 2021-06-30
  • 2022-12-23
  • 2022-01-05
  • 2023-02-16
  • 2022-12-23
  • 2021-10-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-06-14
相关资源
相似解决方案