#include<iostream>
using namespace std;
const int len=66;
const int dive=6;
void sk(char k[],int low ,int high,int level);
int main()
{
char ruler[len];
int i;
for(i=1;i<len-2;i++)
ruler[i]=' ';
ruler[len-1]='\n';
int max=ruler[len-1];
int min=ruler[0];
ruler[min]=ruler[max]='|';
cout<<ruler<<endl;
for(i=1;i<dive;i++)
{
sk(ruler,min,max,i);
cout<<ruler<<endl;
for(int j=1;j<len-2;j++)
ruler[j]=' ';
return 0;
}
void sk(char k[],int low ,int high,int level)
{
if (level==0)
return;
int mid=(high+low)/2;
ar[mid]='|';
sk(k[],low ,mid, level-);
sk(k[] ,mid,high,level-);
}
错误提示为Compiling...
digui2.cpp
D:\My Documents\digui2.cpp(27) : error C2601: 'sk' : local function definitions are illegal
D:\My Documents\digui2.cpp(35) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.
digui2.obj - 1 error(s), 0 warning(s)