| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 442 人关注过本帖
标题:求助!!高手帮我看看错误
只看楼主 加入收藏
wt1558
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2009-9-25
结帖率:0
收藏
 问题点数:0 回复次数:6 
求助!!高手帮我看看错误
# include <stdio.h>

int main()
{
    int stepNo,x,y,fx,fy,stepx,stepy;
   printf("please enter your initial location x and y:");
   scanf(" %d%d",&x,&y);
   printf("Please enter your final location stepfx and stepfy:");
   scanf(" %d%d",&fx,&fy);


   while(x<=fx&&y<=fy)
   {
       if(stepNo%3==0)
       stepx+1,stepy+1;
     printf("x=%d  y=%d\n",x,y);

        x=x+1;
        y=y+1;

   }

getch();
return 0;
}
题目的意思是说在输出之后显示每三步变化一次步长
搜索更多相关主题的帖子: include initial please 
2009-09-25 22:19
wt1558
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2009-9-25
收藏
得分:0 
The similar step only can be used for 3 consecutive movements. After that the movement of the robot must used other steps. The movement of the Keep all new coordinates for a step from origin to destination.  这个是题目
2009-09-25 22:22
m456m654
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:3
帖 子:783
专家分:2806
注 册:2009-9-17
收藏
得分:0 
# include <stdio.h>
 
int main()
{
    int stepNo,x,y,fx,fy,stepx,stepy;
   printf("please enter your initial location x and y:");
   scanf(" %d%d",&x,&y);
   printf("Please enter your final location stepfx and stepfy:");
   scanf(" %d%d",&fx,&fy);
 
 
   while(x<=fx&&y<=fy)
   {
       if(stepNo%3==0) //stepNo没有初始值,而且也没有看到它变化,那不成了固定的一个数了?
       stepx+1,stepy+1; //你这句是什么意思,你是想让stepx和stepy自增吗? 还有你定义的stepx和stepy想干什么?
一是他们也没有被赋予初始值,而是他们想起什么作用?其它地方没提到它们俩。
     printf("x=%d  y=%d\n",x,y);
 
        x=x+1;
        y=y+1;
 
   }
 
getch();
return 0;
}
2009-09-25 22:33
m456m654
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:小飞侠
威 望:3
帖 子:783
专家分:2806
注 册:2009-9-17
收藏
得分:0 
晕,不会一次发出来。
2009-09-25 22:34
wt1558
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2009-9-25
收藏
得分:0 
哦,明白一些了,谢谢楼上了!
2009-09-25 22:53
cxg8790809
Rank: 2
等 级:论坛游民
帖 子:18
专家分:22
注 册:2009-9-25
收藏
得分:0 
程序有点乱了
 又没说明编这个程序有什么目的!
我也在学C语言 ;
有朋友 一起交流的话 可以加我QQ 339170553;
2009-09-25 23:08
beyond_one
Rank: 4
等 级:业余侠客
帖 子:61
专家分:206
注 册:2009-6-26
收藏
得分:0 
stepNo,stepx,stepy没有赋值
2009-09-26 10:07
快速回复:求助!!高手帮我看看错误
数据加载中...
 
   



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

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