ImageVerifierCode 换一换
格式:DOCX , 页数:18 ,大小:76KB ,
资源ID:10397861      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-10397861.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(第二届软件大赛答案.docx)为本站会员(b****1)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

第二届软件大赛答案.docx

1、第二届软件大赛答案第一道大题 下列乘法算式中:每个汉字代表1个数字(19)。相同的汉字代表相同的数字,不同的汉字代表不同的数字。 第 2/2 页 赛软件 * 比赛 = 软件比拼 试编程确定使得整个算式成立的数字组合。#include stdio.h#include stdlib.hbool unequal(int a1,int a2,int a3,int b1) int a4; a0=a1; a1=a2; a2=a3; a3=b1; int i,j; for(i=0;i4;i+) for(j=i+1;j4;j+) if(aj=ai) return false; return true;bool

2、 cal(int a,int b) int a1,a2,a3,b1,b2; a1=a/100; a2=(a-a1*100)/10; a3=a%10; b1=b/10; b2=b%10; if(a1=b2) & unequal(a1,a2,a3,b1) return true; return false;bool dif(int c4,int a1,int a2,int a3,int b1) int a4; a0=a1; a1=a2; a2=a3; a3=b1; for(int i=0;i4;i+) if(c4=ai)return false; return true; bool cal1(in

3、t a,int b,int c) int a1,a2,a3,b1,b2,c1,c2,c3,c4; a1=a/100; a2=(a-a1*100)/10; a3=a%10; b1=b/10; b2=b%10; c1=c/1000; c2=(c-c1*1000)/100; c3=(c-c1*1000-c2*100)/10; c4=c%10; if(c1=a2) & (c2=a3) & (c3=b1) & dif(c4,a1,a2,a3,b1) return true; return false; int main() int FirstNum,SecondNum,Result; for(First

4、Num=111;FirstNum=999;FirstNum+) for(SecondNum=11;SecondNum=1111 & Result, , , , , , , ,= ;int LocateVex(char a) for(int i=0;i=0 & c=9) return true; return false; char Precede(char a,char c) int i=LocateVex(a); int j=LocateVex(c); return tableij;int cal(int a,char op,int b) if(b=0 & op=/)flag=1;retur

5、n -1; switch(op) case +:return a+b;break; case -:return a-b;break; case *:return a*b;break; case /:return a/b;break; default:break; void func(char Mstr80) char str80; int len; char op; int num1; int num2; int result; int i,j,k; char c; /printf(n 请输入要求值的表达式 n); /gets(str); strcpy(str,Mstr); DisposeSt

6、r(str); len=strlen(str); /printf(%d,len); InitOpndStack(); InitOptrStack(); PushOptrStack(#); i=0; c=stri+; while(c!=# | GetTopOptr()!=#) if(isOpnd(c)PushOpndStack(c-0);c=stri+; else switch(Precede(GetTopOptr(),c) case : op=PopOptrStack(); num2=PopOpndStack(); num1=PopOpndStack(); result=cal(num1,op

7、,num2); if(flag=0) PushOpndStack(result); break; default:break; if(flag=1)break; if(flag=1) flag=0;return; else int total=GetTopOpnd(); if(total=24) printf(n %s 结果是 %dn,Mstr,total); char converse(int i) switch(i-1) case 0:return +;break; case 1:return -;break; case 2:return *;break; case 3:return /;

8、break; default:break; int main() char temp80; int i=0; int digit4; int op3; int k; for(digit0=1;digit0=9;digit0+) for(digit1=1;digit1=9;digit1+) for(digit2=1;digit2=9;digit2+) for(digit3=1;digit3=9;digit3+) for(op0=1;op0=4;op0+) for(op1=1;op1=4;op1+) for(op2=1;op2=4;op2+) for(k=0;k10;k+) if(k=0) tem

9、p0=digit0+0; temp1=converse(op0); temp2=digit1+0; temp3=converse(op1); temp4=digit2+0; temp5=converse(op2); temp6=digit3+0; temp7=0; func(temp); else if(k=1) temp0=(; temp1=digit0+0; temp2=converse(op0); temp3=digit1+0; temp4=); temp5=converse(op1); temp6=digit2+0; temp7=converse(op2); temp8=digit3+

10、0; temp9=0; func(temp); else if(k=2) temp0=digit0+0; temp1=converse(op0); temp2=(; temp3=digit1+0; temp4=converse(op1); temp5=digit2+0; temp6=); temp7=converse(op2); temp8=digit3+0; temp9=0; func(temp); else if(k=3) temp0=digit0+0; temp1=converse(op0); temp2=digit1+0; temp3=converse(op1); temp4=(; t

11、emp5=digit2+0; temp6=converse(op2); temp7=digit3+0; temp8=); temp9=0; func(temp); else if(k=4) temp0=(; temp1=digit0+0; temp2=converse(op0); temp3=digit1+0; temp4=converse(op1); temp5=digit2+0; temp6=); temp7=converse(op2); temp8=digit3+0; temp9=0; func(temp); else if(k=5) temp0=digit0+0; temp1=conv

12、erse(op0); temp2=(; temp3=digit1+0; temp4=converse(op1); temp5=digit2+0; temp6=converse(op2); temp7=digit3+0; temp8=); temp9=0; func(temp); else if(k=6) temp0=(; temp1=(; temp2=digit0+0; temp3=converse(op0); temp4=digit1+0; temp5=); temp6=converse(op1); temp7=digit2+0; temp8=); temp9=converse(op2);

13、temp10=digit3+0; temp11=0; func(temp); else if(k=7) temp0=(; temp1=digit0+0; temp2=converse(op0); temp3=(; temp4=digit1+0; temp5=converse(op1); temp6=digit2+0; temp7=); temp8=); temp9=converse(op2); temp10=digit3+0; temp11=0; func(temp); else if(k=8) temp0=digit0+0; temp1=converse(op0); temp2=(; tem

14、p3=(; temp4=digit1+0; temp5=converse(op1); temp6=digit2+0; temp7=); temp8=converse(op2); temp9=digit3+0; temp10=); temp11=0; func(temp); else if(k=9) temp0=digit0+0; temp1=converse(op0); temp2=(; temp3=digit1+0; temp4=converse(op1); temp5=(; temp6=digit2+0; temp7=converse(op2); temp8=digit3+0; temp9=); temp10=); temp11=0; func(temp); else system(pause); return 0;

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2