[자료(資料)구조] 재귀함수
페이지 정보
작성일 23-05-03 12:12
본문
Download : 재귀함수.hwp
{
다. fin>>command;
Findcomp(image,row,col-1,label,m,n);
void Findcomp(int image[][100],int row,int col, int label,int m, int n)
설명
#include
if( row < m-1 && image[row+1][col] == 1)
if( col < n-1 && image[row][col+1] == 1)
void main()
Findcomp(image,row,col+1,label,m,n);
if( col > 0 && image[row][col-1] == 1)
//아래쪽을 본다
Findcomp(image,row-1,col,label,m,n);
//위를 본다
int i,j,m,n;
순서
위한 소
}
int image[100][100];
자료구조 재귀 재귀함수
자료(資料)구조 수업에 나오는 레폿
ifstream fin(`input.txt`);
#include
#include
자료구조 수업에 나오는 레폿
Findcomp(image,row+1,col,label,m,n);
using namespace std;
{
//왼쪽을 본다
[자료(資料)구조] 재귀함수
string str; //int형의 배열에 집어넣기 위해 string형 변수 선언
레포트 > 공학,기술계열
Download : 재귀함수.hwp( 24 )
int command; //몇번의 실행을 할것인가에 대한 명령을 위한 함수
if( row > 0 && image[row-1][col] == 1)
image[row][col] = label;
//오른쪽을 본다.


