c语言中所有函数图像 c语言中所有函数图像怎么表示

怎样用C语言画一个函数的图像啊和数学上一样啊 来个坐标x,y分别表示列和行。在函数上就打印一个*给个范围,双层循环加条件就可以了
怎么用C语言绘制函数图像,要用visual c++6.0可以运行出来需要Window图像编程,Window编程就是基于C语言的 , 在Visual C++6.0可以编写Win32程序
C语言输出sin的函数图像对于显示的输出,不是用所有输出点X减1就能显示的 。你需要把原来的点擦除后,再将坐标减1后重新画才可以 。
关于c语言图像函数晕,黑屏是因为运行程序切换到DOS全屏了,
用 Alt + Enter 切换到windows
用 Alt + Tab 也可以切换到windows
【c语言中所有函数图像 c语言中所有函数图像怎么表示】我这里用的WinXP,很正常,黑色背景,白色的线条
----------------------------------------------
#includegraphics.h
void main()
{
int driver,mode;
driver=DETECT;
mode=0;
initgraph(driver,mode,"");
setcolor(15);
line(66,66,88,88);
lineto(100,100);
linerel(36,64);
getch();
restorecrtmode();
}
用C语言输出CosX,SinX函数图像的问题,新手求解把c语言中所有函数图像你c语言中所有函数图像的printf("*/n")改为printf("*\n")c语言中所有函数图像,其它的/n也改为\n看看行不行 。
#include stdio.h
#include math.h
int main()
{
double y;
double x, m, i;
for(y=1;y=-1;y-=0.1)
{
if(y=0)
{
m=asin(y)*10;
for(x=1;xm;x++)
printf(" ");
printf("+");
for(;x31-m;x++)
printf(" ");
printf("*\n");
}
else
{
m=-1*asin(y)*10;
for(i=0;i32;i++)
printf(" ");
for(x=1;xm;x++)
printf(" ");
printf("_");
for(;x31-m;x++)
printf(" ");
printf("m\n");
m=asin(y)*10;
for(x=1;xm;x++)
printf(" ");
}
}
return 0;
}
用c语言画一个2次函数图像#include windows.h
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
static TCHAR szAppName[]=TEXT("二次函数");
HWNDhwnd;
MSGmsg;
WNDCLASSwndclass;
wndclass.style=CS_HREDRAW|CS_VREDRAW;
wndclass.lpfnWndProc=WndProc;
wndclass.cbClsExtra=0;
wndclass.cbWndExtra=0;
wndclass.hInstance=hInstance;
wndclass.hIcon=LoadIcon(NULL, IDI_APPLICATION);
wndclass.hCursor=LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);
wndclass.lpszMenuName=NULL;
wndclass.lpszClassName=szAppName;
if (!RegisterClass(wndclass))
{
MessageBox(NULL, TEXT("Error"),
szAppName, MB_ICONERROR);
return 0;
}
hwnd=CreateWindow(szAppName, TEXT("二次函数"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, hInstance, NULL);
ShowWindow(hwnd, iCmdShow);
UpdateWindow(hwnd);
while (GetMessage(msg, NULL, 0, 0))
{
TranslateMessage(msg);
DispatchMessage(msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static intcxClient, cyClient;
const static int n=1000;
HDChdc;
inti;
PAINTSTRUCT ps;
POINTapt[n];
switch (message)
{
case WM_SIZE:
cxClient=LOWORD(lParam);
cyClient=HIWORD(lParam);
return 0;
case WM_PAINT:
hdc=BeginPaint(hwnd, ps);
MoveToEx(hdc, 0, cyClient/2, NULL);
LineTo(hdc, cxClient, cyClient/2);
MoveToEx(hdc, cxClient/2, 0, NULL);
LineTo(hdc, cxClient/2, cyClient);

推荐阅读