U E D R , A S I H C RSS

LCD-Display/김상섭

워롱 엔서

~cpp
#include <iostream> 
#include <vector> 
using namespace std; 
int size, i, j, k, l; 
char character[10][7] = {{'-','|','|',' ','|','|','-'},{' ',' ','|',' ',' ','|',' '},{'-',' ','|','-','|',' ','-'}, 
{'-',' ','|','-',' ','|','-'},{' ','|','|','-',' ','|',' '},{'-','|',' ','-',' ','|','-'}, 
{'-','|',' ','-','|','|','-'},{'-',' ','|',' ',' ','|',' '},{'-','|','|','-','|','|','-'},{'-','|','|','-',' ','|','-'}}; 

char num[10]; 
vector<int> test; 

void process() 
{ 
	for(i = 0; i < 1 ; i++) 
	{ 
		for(j = 0; j < test.size(); j++) 
		{ 
			cout << " "; 
			for(k = 0; k < size; k++) 
				cout << character[test[j]][0]; 
			if(j != test.size() -1)
				cout << "  "; 
		}		
	} 
	cout << endl;
	
	for(; i < size + 1 ; i++) 
	{ 
		for(j = 0; j < test.size() ; j++) 
		{ 
			cout << character[test[j]][1]; 
			for(k = 0; k < size; k++) 
				cout << " "; 
			cout << character[test[j]][2]; 
			if(j != test.size() -1)
				cout << " ";
		} 
		cout << "\n"; 
	} 
	
	for(; i < size + 2 ; i++) 
	{ 
		for(j = 0; j < test.size() ; j++) 
		{ 
			cout << " "; 
			for(k = 0; k < size; k++) 
				cout << character[test[j]][3]; 
			if(j != test.size() -1)
				cout << "  ";
		} 
	} 
	cout << endl; 
	
	for(; i < 2 * size + 2 ; i++) 
	{ 
		for(j = 0; j < test.size() ; j++) 
		{ 
			cout << character[test[j]][4]; 
			for(k = 0; k < size; k++) 
				cout << " "; 
			cout << character[test[j]][5]; 
			if(j != test.size() -1)
				cout << " ";
		} 
		cout << "\n"; 
	} 
	
	for(; i < 2 * size + 3 ; i++) 
	{ 
		for(j = 0; j < test.size() ; j++) 
		{ 
			cout << " "; 
			for(k = 0; k < size; k++) 
				cout << character[test[j]][6]; 
			if(j != test.size() -1)
				cout << "  ";
		} 
	} 
	cout << endl; 

} 

int main() 
{ 
    cin >> size >> num; 
     
    while(num != 0 && num[0] != '0') 
    { 
        for(i = 0; num[i] != '\0'; i++) 
            test.push_back(num[i]-48); 
        process(); 
        test.clear(); 
        cin >> size >> num; 
    } 

    return 0; 
} 
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:36
Processing time 0.0125 sec