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.0278 sec