本文目录一览

1,24点计算器 在线等 1 5 5 5

5-(1/5)*5

24点计算器 在线等 1 5 5 5

2,速算二十四点

(3/7+3)*7 24点计算器: http://www.qqcn.net/downinfo/2940.html

速算二十四点

3,24点计算器2 5 7 8怎样24点

:(2 × 5 - 7) × 8=24
2 × 5 - 7) × 8
(2*5-7)*8=24 24=3*8=2*12=4*6=1*24 从已知可能入手

24点计算器2 5 7 8怎样24点

4,24点计算器8661

6÷(1-6÷8)=24
你好 下面的小程序有一些笨(语法很简单) 它无法分辨一些重复的情况 但结果还是基本正确的 #include<iostream> using namespace std; int main() int i1,i2,i3,i4,v,n1,n2; int num=0; int a,b; double t1,t2,t3,t4,choice[4],s1[4],s2[4][4],s3[2],t; for(;;) cout<<"########################## 二十四点 ###################################\友情提示:a=1,j=11,q=12,k=13\"; cout<<"请给出你抽到的第一牌:"; cin>>choice[0]; cout<<"请给出你抽到的第二牌:"; cin>>choice[1]; cout<<"请给出你抽到的第三牌:"; cin>>choice[2]; cout<<"请给出你抽到的第四牌:"; cin>>choice[3]; cout<<"########################## thinking ###################################\"; for(b=0;b<=2;b++) for(a=3;a>=1+b;a--)if(choice[a]<choice[a-1]) t=choice[a-1]; choice[a-1]=choice[a]; choice[a]=t;} for(int j=0;j<4;j++)cout<<j+1<<". "<<choice[j]<<" "; cout<<"\"; for(i1=0;i1<4;i1++) t1=choice[i1]; for(i2=0;i2<4;i2++) if(i2!=i1) t2=choice[i2]; s1[0]=t1+t2; s1[1]=t1-t2; s1[2]=t1*t2; s1[3]=t1/t2; for(i3=0;i3<4;i3++) if(i3!=i1&&i3!=i2) t3=choice[i3]; for(v=0;v<4;v++) s2[v][1]=s1[v]-t3; s2[v][2]=s1[v]*t3; s2[v][3]=s1[v]/t3;} for(i4=0;i4<4;i4++) if(i4!=i1&&i4!=i2&&i4!=i3) t4=choice[i4]; for(n1=0;n1<4;n1++)for(n2=0;n2<4;n2++) if(s2[n1][n2]+t4==24||s2[n1][n2]-t4==24||s2[n1][n2]*t4==24||s2[n1][n2]/t4==24) cout<<"找到一种组合方案:\(("<<t1; if(s1[n1]==t1+t2)cout<<" + "; if(s1[n1]==t1-t2)cout<<" - "; if(s1[n1]==t1*t2)cout<<" * "; if(s1[n1]==t1/t2)cout<<" / "; if(n2==0)cout<<t2<<") + "<<t3; if(n2==1)cout<<t2<<") - "<<t3; if(n2==2)cout<<t2<<") * "<<t3; if(n2==3)cout<<t2<<") / "<<t3; if(s2[n1][n2]+t4==24)cout<<") + "<<t4<<" = 24 \"; if(s2[n1][n2]-t4==24)cout<<") - "<<t4<<" = 24 \"; if(s2[n1][n2]*t4==24)cout<<") * "<<t4<<" = 24 \"; if(s2[n1][n2]/t4==24)cout<<") / "<<t4<<" = 24 \"; num++; } }}} }}}} for(i1=0;i1<4;i1++) t1=choice[i1]; for(i2=0;i2<4;i2++) if(i2!=i1) t2=choice[i2]; s1[0]=t1*t2; s1[1]=t1/t2; for(i3=0;i3<4;i3++) if(i3!=i1&&i3!=i2) t3=choice[i3]; for(i4=0;i4<4;i4++) if(i4!=i1&&i4!=i2&&i4!=i3) t4=choice[i4]; s3[0]=t3*t4; s3[1]=t3/t4; for(n1=0;n1<2;n1++)for(n2=0;n2<2;n2++) if(s1[n1]+s3[n2]==24||s1[n1]-s3[n2]==24) cout<<"找到一种组合方案:\("<<t1; if(s1[n1]==t1*t2)cout<<" * "; if(s1[n1]==t1/t2)cout<<" / "; if(s1[n1]+s3[n2]==24)cout<<t2<<") + ("<<t3; if(s1[n1]-s3[n2]==24)cout<<t2<<") - ("<<t3; if(s3[n2]==t3*t4)cout<<" * "<<t4<<") = 24 \"; if(s3[n2]==t3/t4)cout<<" / "<<t4<<") = 24 \"; num++; } }}} }}}} cout<<"总共有"<<num<<"种解法。\"; if(num==0)cout<<"这四张牌无法构成24点~~~\"; num=0; } return 0; }

5,24点计算器

你好下面的小程序有一些笨(语法很简单)它无法分辨一些重复的情况但结果还是基本正确的#include<iostream>using namespace std;int main()int i1,i2,i3,i4,v,n1,n2;int num=0;int a,b;double t1,t2,t3,t4,choice[4],s1[4],s2[4][4],s3[2],t;for(;;)cout<<"########################## 二十四点 ###################################\n友情提示:A=1,J=11,Q=12,K=13\n";cout<<"请给出你抽到的第一牌:";cin>>choice[0];cout<<"请给出你抽到的第二牌:";cin>>choice[1];cout<<"请给出你抽到的第三牌:";cin>>choice[2];cout<<"请给出你抽到的第四牌:";cin>>choice[3];cout<<"########################## THINKING ###################################\n";for(b=0;b<=2;b++)for(a=3;a>=1+b;a--)if(choice[a]<choice[a-1]) t=choice[a-1]; choice[a-1]=choice[a]; choice[a]=t;}for(int j=0;j<4;j++)cout<<j+1<<". "<<choice[j]<<" ";cout<<"\n";for(i1=0;i1<4;i1++)t1=choice[i1];for(i2=0;i2<4;i2++)if(i2!=i1)t2=choice[i2];s1[0]=t1+t2;s1[1]=t1-t2;s1[2]=t1*t2;s1[3]=t1/t2;for(i3=0;i3<4;i3++)if(i3!=i1&&i3!=i2)t3=choice[i3];for(v=0;v<4;v++)s2[v][1]=s1[v]-t3;s2[v][2]=s1[v]*t3;s2[v][3]=s1[v]/t3;}for(i4=0;i4<4;i4++)if(i4!=i1&&i4!=i2&&i4!=i3)t4=choice[i4];for(n1=0;n1<4;n1++)for(n2=0;n2<4;n2++)if(s2[n1][n2]+t4==24||s2[n1][n2]-t4==24||s2[n1][n2]*t4==24||s2[n1][n2]/t4==24)cout<<"找到一种组合方案:\n(("<<t1;if(s1[n1]==t1+t2)cout<<" + ";if(s1[n1]==t1-t2)cout<<" - ";if(s1[n1]==t1*t2)cout<<" * ";if(s1[n1]==t1/t2)cout<<" / ";if(n2==0)cout<<t2<<") + "<<t3;if(n2==1)cout<<t2<<") - "<<t3;if(n2==2)cout<<t2<<") * "<<t3;if(n2==3)cout<<t2<<") / "<<t3; if(s2[n1][n2]+t4==24)cout<<") + "<<t4<<" = 24 \n"; if(s2[n1][n2]-t4==24)cout<<") - "<<t4<<" = 24 \n"; if(s2[n1][n2]*t4==24)cout<<") * "<<t4<<" = 24 \n"; if(s2[n1][n2]/t4==24)cout<<") / "<<t4<<" = 24 \n";num++;}}}}}}}}for(i1=0;i1<4;i1++)t1=choice[i1];for(i2=0;i2<4;i2++)if(i2!=i1)t2=choice[i2];s1[0]=t1*t2;s1[1]=t1/t2;for(i3=0;i3<4;i3++)if(i3!=i1&&i3!=i2)t3=choice[i3];for(i4=0;i4<4;i4++)if(i4!=i1&&i4!=i2&&i4!=i3)t4=choice[i4];s3[0]=t3*t4;s3[1]=t3/t4;for(n1=0;n1<2;n1++)for(n2=0;n2<2;n2++)if(s1[n1]+s3[n2]==24||s1[n1]-s3[n2]==24)cout<<"找到一种组合方案:\n("<<t1;if(s1[n1]==t1*t2)cout<<" * ";if(s1[n1]==t1/t2)cout<<" / ";if(s1[n1]+s3[n2]==24)cout<<t2<<") + ("<<t3;if(s1[n1]-s3[n2]==24)cout<<t2<<") - ("<<t3; if(s3[n2]==t3*t4)cout<<" * "<<t4<<") = 24 \n"; if(s3[n2]==t3/t4)cout<<" / "<<t4<<") = 24 \n"; num++;}}}}}}}}cout<<"总共有"<<num<<"种解法。\n";if(num==0)cout<<"这四张牌无法构成24点~~~\n";num=0;}return 0;}
123
http://www.zplusz.org/DownLoad/M-junior/24dian.rar如果不行的话,就去http://www.zplusz.org/DownloadCenter.htm,下载二十四点游戏,可以自己练,也可以出题
3. 4 .9 .10 / 5. 7. 11. 12/1. 2. 7. 13/2. 3. 9. 11 (9-3)*(10-4)=24(13-7-2)!*1=24 ((11-9)*(3-2)!=24

文章TAG:二十四点计算器二十四  二十四点  十四  
下一篇