Ejemplo n.º 1
0
int main()
{
    freopen("moves.in","r",stdin);
    freopen("moves.out","w",stdout);
    char s[10];
	int t, cases = 0;
	scanf("%d", &t);
	char G[20];
	char c;
	while (t--) {
        int i = 0;
		cases++;
		printf("Test Case #%d: \n", cases);
		for(int i = 0 ; i < 4 ; i++){
                scanf("%s",s);
                for(int j = 0 ; j < 4 ; j++){
                        G[i*4+j] = s[j];
                }
        }
        G[16] = '\0';
        
        PrintPos(G);
	}
	char c11 = getchar();
	c11 = getchar();
    return 0;
}
Ejemplo n.º 2
0
void PrintPos(NODE *head, int pos_y){
	
	if(head->m_PLeftChild){
		PrintPos(head->m_PLeftChild, pos_y - 1);
	}

	if(g_pos_x == -1){
		g_pos_x = 0;
		std::cout << "data:" << head->m_data << "  pos_x:" << g_pos_x << "  pos_y:" << pos_y << std::endl;
	}
	else{
		++g_pos_x;
		std::cout << "data:" << head->m_data << "  pos_x:" << g_pos_x << "  pos_y:" << pos_y << std::endl;
	}

	if(head->m_RightChild){
		PrintPos(head->m_RightChild, pos_y -1);
	}
}
Ejemplo n.º 3
0
 void Visit(IRBlock* block, unsigned int indent)
 {
     // Indent(indent) << "<block>\n";
     // if (block->CanCompile()) 
     //    Indent(indent) << "// <CanCompile>\n";
     const IRInsts& insts = block->GetInsts();
     IRInsts::const_iterator it;
     for (it = insts.begin(); it != insts.end(); ++it) {
         IRInst* inst = *it;
         PrintPos(inst, indent);
         Indent(indent) << *inst << ";\n";
     }
     // if (block->CanCompile()) 
     //     Indent(indent) << "// </CanCompile>\n";
     // Indent(indent) << "</block>\n";
 }