U E D R , A S I H C RSS

숫자를한글로바꾸기/조현태

느낀


가 길 stack라는 .. LittleAOI 만들 2다.
려먹는뭐.,ㅎㅎㅎ 고.ㅎ
로그래머 라고나 까..ㅎㅎㅎ

뭐.. 문 까 '만'라고 만.. 닷..ㅠ.ㅜ 문..ㅠ.ㅜ

~cpp 
#include <iostream>

using namespace std;

const bool TRUE=1; 
const bool FALSE=0;
const int MAX_LONG=5;//대가 5기때문.
const int MAX_NUMBER=10000;//대가 10000기때문.

class stack 
{ 
private: 
	char *data_p; 
	int where_is_save; 
	int max_size_of_stack; 
public: 
	stack( int data_size ) 
	{ 
		data_p=(char*)malloc(data_size*sizeof(char)); 
		max_size_of_stack=data_size; 
		where_is_save=0; 
	} 
	~stack() 
	{ 
		free(data_p); 
	} 
	bool get_in(char save_data) 
	{ 
		if (where_is_save != max_size_of_stack) 
		{ 
			*(data_p+where_is_save)=save_data; 
			++where_is_save; 
			return TRUE; 
		} 
		else 
			return FALSE; 
	} 
	bool get_out(char *where_save_p ) 
	{ 
		if (where_is_save) 
		{ 
			--where_is_save; 
			*where_save_p=*(data_p+where_is_save); 
			return TRUE; 
		} 
		return FALSE; 
	} 
	void clear_data() 
	{ 
		where_is_save=0; 
	} 
}; 


void main()
{
	// 
	const char NUMBER_TO_HAN[10][3]={"","","","","","","","","","구"};
	const char NUMBER_TO_JARI[5][3]={"","","","","만"};
	stack print_number(MAX_LONG);
	int input_number=-1;
	char jari=-1;
	//력
	while (input_number<0 || input_number>=MAX_NUMBER)
	{
		system("CLS");
		cout << "력 : ";
		cin >> input_number;
	}
	//
	while (input_number>0)
	{
		print_number.get_in(input_number%10);
		input_number/=10;
		++jari;
	}
	//력
	cout << "력 : ";
	char temp;
	if (jari==-1)
		cout << NUMBER_TO_HAN[0];
	while (print_number.get_out(&temp))
	{
		if (temp!=0)
			cout << NUMBER_TO_HAN[temp] << NUMBER_TO_JARI [jari];
		--jari;
	}
}

만 객고 malloc -_-;;; 브리드 다 -_-;;; -_-;;;
.. 다. ..ㅎ 브리드 만 더 말 . 가 8 1 데, 그때, 더 나 를 만들겠다.^^ -
;; 그런게 구... C면 C답게 는 것 구 C++면 C++답게 는게 데.. malloc C . 물론 C++ 만 C 때문 말로 는것 new까 new를 는게 다는. 를 malloc로는 당 못든.

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:30:15
Processing time 0.0105 sec