¶
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));
}
}










