Fractal---POJ2083 (dfs)

Source: Internet
Author: User

Together, I think it's a little disgusting. DFS was initially not initialized with g++, and then with C + + turned out to be WA. That must be my problem.

Finally found no initialization

Dfs still feels like it's not too much to know when to really learn

#include <stdio.h>#include<string.h>#include<algorithm>#include<stdlib.h>#include<math.h>#include<iostream>using namespacestd;#defineN 1100#defineINF 0xFFFFFFFF#defineMemset (A, B) memset (A,b,sizeof (a))CharStr[n][n];voidDasointNintXinty) {    if(n==1) {Str[x][y]='X'; return; }    intH=pow (3.0, N-2); DFS (n-1, x, y), or///upper-left corner DFS (n-1, x,y+2*h)////upper right-hand corner DFS (n-1, x+h,y+h);///Intermediate DFS (n-1, x+2*h,y)///////lower left corner DFS (n-1, x+2*h,y+2*h);///Lower right corner}intMain () {memset (str,' '); DFS (7,1,1); intm;  while(SCANF ("%d", &m), m!=-1)    {        intD=pow (3.0, M-1);  for(intI=1; i<=d;i++)        {             for(intj=1; j<=d;j++) {printf ("%c", Str[i][j]); } printf ("\ n"); } printf ("-\n"); }    return 0;}

Fractal---POJ2083 (dfs)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.