| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 395 人关注过本帖
标题:o(∩_∩)o...求助...给余猜数的游戏
只看楼主 加入收藏
amormio
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-10-29
收藏
 问题点数:0 回复次数:1 
o(∩_∩)o...求助...给余猜数的游戏
心里想好一个在1~100之间的整数,将他分别除以3,4,7并得到3个余数。你把这3个余数告诉计算机,计算机马上能猜出你心中的这个数;
void main()
{
int a,b,c,d;
cout<<"enter anumber between 1 and 100."<<endl;
cout<<"your number divided by 3 has a remainder of"<<endl;
cin>>a;
cout<<"your number divided by 4 has a remainder of"<<endl;
cin>>b;
cout<<"your number divided by 7 has a remainder of"<<endl;
cin>>c;
cout<<"let me think a moment..."<<endl;
for(i=1;i<1500;i++) //消耗时间,不会写的哈
d=28*a+21*b+36*C;
while (d>105) d+d-105;
cout<<"your number was"<<endl;
}
这个程序出现了一些问题,不会的额
谢谢帮助哈 (*^__^*) 嘻嘻……
2007-10-29 16:30
amormio
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2007-10-29
收藏
得分:0 
回复:(amormio)o(∩_∩)o...求助...给余猜数的游戏...
void main()
{
int a,b,c,d;
cout<<"enter anumber between 1 and 100."<<endl;
cout<<"your number divided by 3 has a remainder of"<<endl;
cin>>a;
cout<<"your number divided by 4 has a remainder of"<<endl;
cin>>b;
cout<<"your number divided by 7 has a remainder of"<<endl;
cin>>c;
cout<<"let me think a moment..."<<endl;
do{ //消耗时间,不会写的哈
i++;
}while(i<1500);
d=28*a+21*b+36*C;
while (d>84) d=d-84;
cout<<"your number was"<<endl;
}
哭哭哭o(∩_∩)o...
哭哭哭o(∩_∩)o...
哭哭哭o(∩_∩)o...
哭哭哭o(∩_∩)o...
哭哭哭o(∩_∩)o...

2007-10-29 19:22
快速回复:o(∩_∩)o...求助...给余猜数的游戏
数据加载中...
 
   



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

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