判断是否能进入重点大学:满足条件1、语数外全A,其他6门只有1个C,四个A。2、语数外有一个B两个A,其他6门6个A'

注意:定义数组里面的字符要加引号,取余要用mod,等于就是=,asp只能用form表单获取值,而且好像不可以动态获取form表单的值,我发现数组定义的时候str(8)就可以保存9个值


	
   
   
语文:
数学:
英语:
物理:
化学:
生物:
政治:
历史:
地理:
<% '判断是否能进入重点大学:满足条件1、语数外全A,其他6门只有1个C,四个A。2、语数外有一个B两个A,其他6门6个A' '获取值' dim str(8) str(0)=request.form("chinese") str(1)=request.form("math") str(2)=request.form("english") str(3)=request.form("physics") str(4)=request.form("chemistry") str(5)=request.form("biology") str(6)=request.form("political") str(7)=request.form("history") str(8)=request.form("geography") '循环分数改成等级,分为A,B,C,D,和其他(如果是其他则赋值为空)' for i=0 to 8 if str(i)>=90 then str(i)="A" elseif str(i)>=85 and str(i)<90 then str(i)="B" elseif str(i)>=70 and str(i)<85 then str(i)="C" elseif str(i)>0 then str(i)="D" else str(i)="" end if next '循环数组,A则加100,B则加10,C则加1,D不处理,空值的时候将flag=0' dim b,c,flag flag=1 for i=0 to 2 if str(i)="A" then b=b+100 elseif str(i)="B" then b=b+10 elseif str(i)="C" then b=b+1 elseif str(i)="D" then else flag=0 end if next for i=3 to 8 if str(i)="A" then c=c+100 elseif str(i)="B" then c=c+10 elseif str(i)="C" then c=c+1 elseif str(i)="D" then else flag=0 end if next 'flag=0时说明没有完整的输入分数' if (b=300 and c mod 10<=1 and c>=411 and flag=1) or (b=210 and c=600 and flag=1) then response.write ("能进入重点大学") elseif flag=0 then response.write "请输入全部的成绩" else response.write "不能进入重点大学" end if %>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值