| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 947 人关注过本帖
标题:小白写的小程序不知道错在哪里,请指正,
取消只看楼主 加入收藏
晨阳、
Rank: 2
等 级:论坛游民
帖 子:44
专家分:20
注 册:2017-3-4
结帖率:72.73%
收藏
已结贴  问题点数:20 回复次数:0 
小白写的小程序不知道错在哪里,请指正,
#include <stdio.h>

int main()
{
    void hanoi(int n,char one,char two,char three);
    int m;
    printf("input the number of diskes:");
    scanf("%d",&m);
    printf("The step to move %d diskes:\n",m);
    hamoi(m,'A','B','C');

return 0;
}

void hanoi(int n, char one, char two, char three)

{
void move(char x,char y);

if(n==1)
    move(one,three);
else
    {
    hanoi(n-1,one,three,two);
    move(one,three);
    hanoi(n-1,two,one,three);
    }
}

void move(char x,char y)
{
    printf("%c->%c\n",x,y);
}
搜索更多相关主题的帖子: include number return 
2017-04-02 15:06
快速回复:小白写的小程序不知道错在哪里,请指正,
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015661 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved