느낀 ¶
들 부 늘 3-4 밖 못더..
딩 못겠다는..
다.. 고 고,, 뭐는 까먹고.. 보고..다 고..
그래 가 망듯..
그런데 모가 보 떻게 못겠다는..
.. 다.
그런데 루 그냥다공.. 문 답 라 는겨?ㅎ
딩 못겠다는..
다.. 고 고,, 뭐는 까먹고.. 보고..다 고..
그래 가 망듯..
그런데 모가 보 떻게 못겠다는..
.. 다.
그런데 루 그냥다공.. 문 답 라 는겨?ㅎ
내 말데.
단 그래가 무 길(y값 25나 나. 로 25면 반 리는.. 로 그맣게 궁..ㅎㅎ)tab 기로.
래 모 보고면 TAB_Y 값 1로 면 됨.
tab값 1 값로 때, 단 반림 게 두나, 래 때는 부 값 는데, 귀 놔두더 1로 내려때는 그래 복되는 긴다는..
가급 !ㅎ( X값..ㅎ)
단 그래가 무 길(y값 25나 나. 로 25면 반 리는.. 로 그맣게 궁..ㅎㅎ)tab 기로.
래 모 보고면 TAB_Y 값 1로 면 됨.
tab값 1 값로 때, 단 반림 게 두나, 래 때는 부 값 는데, 귀 놔두더 1로 내려때는 그래 복되는 긴다는..
가급 !ㅎ( X값..ㅎ)
근데 그래 그리는 로 면 방 되.;
¶
~cpp
#include <iostream>
#include <windows.h>
using namespace std;
const int MIN_X=-5;
const int MAX_X=5;
const float TAB_X=1;
const float TAB_Y=0.5;
int banollim(float number)
{
//반림는
float temp_sosu=number-(int)number;
if (temp_sosu<=-0.5 || temp_sosu>=0.5)
++number;
return number;
}
void gotoxy(int x, int y)
{
COORD Pos = {x - 1, y - 1};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Pos);
}
float function_x_to_y(float x)
{
// 그림
float y=x*x;
return y;
}
void make_image(int where_x, int where_y, float min_x, float max_x, float tab_x, float tab_y)
{
// 부 그리기 x, y, x값, x대값, x격, y격
////기.
int max_y=0;
int min_y=function_x_to_y(min_x);
//y 대 구
for (register float x=min_x; x<=max_x; x+=tab_x)
{
if (max_y<function_x_to_y(x))
max_y=function_x_to_y(x);
else if (min_y>function_x_to_y(x))
min_y=function_x_to_y(x);
}
////x,y
for (register float x=min_x; x<=max_x; ++x)
{
gotoxy(banollim(x-min_x+1+where_x),(where_y+max_y*tab_y));
printf (".");
}
for (register float y=min_y; y<=max_y; ++y)
{
gotoxy(banollim(-min_x+1+where_x),(where_y-banollim(y)*tab_y+max_y*tab_y));
printf (".");
}
////그래
for (register float x=min_x; x<=max_x; x+=tab_x)
{
gotoxy(banollim(x-min_x+1+where_x),(where_y-banollim(function_x_to_y(x))*tab_y+max_y*tab_y));
printf ("*");//(%.1f,%.1f)",x,function_x_to_y(x));
}
}
void main()
{
system("CLS");
cout << "2 력 로그램.";
make_image( 10 , 5 , MIN_X, MAX_X,TAB_X,TAB_Y);
gotoxy(30,5);
cout << "x y";
for (register int i=0; i<MAX_X-MIN_X+1;i+=1)
{
gotoxy(30,i+6);
printf ("%3d -> %3.0f",i+MIN_X,function_x_to_y(i+MIN_X));
}
}










