这是java的代码:
你还要android的?真奇怪的要求等会儿我写写
import java.util.Scanner;
public class hhh {
public static void main(String[] args) {
int zhu = 0, da = 0, xing = 0, ji = 0;
Scanner sc = new Scanner(System.in);
System.out.print("请输入星级:");
xing = sc.nextInt();
while (xing != 0) {
System.out.print("请输入等级:");
ji = sc.nextInt();
System.out.print("请输入主属性:");
zhu = sc.nextInt();
switch (xing) {
case 3:
da = 149 + zhu - (17 + ji) / 2;
break;
case 4:
da = 149 + zhu - (31 + ji) / 2;
break;
case 5:
da = 149 + zhu - (49 + ji) / 2;
break;
}
System.out.println(da);
}
System.out.print("请输入星级:");
xing = sc.nextInt();
}
}
如果你在输入的时候报错了那是你没输入个整数啊啊,懒得给你判断验证了
好了android版的完工了
项目见附件,apk安装文件在项目的\bin\文件夹下
---------------------------------
ps:LZ坑货么 都没留邮箱选个所谓的“已发邮箱”的答案,自己拿小号来回收积分的吧,这样以后谁认真答你问题?
public class Test(){
public void static main(String[] args)
{
int zhu,da,xing.ji;
Scanner sc=new Scanner(System.in);
System.out.print("请输入星级");
xing=sc.next();
while(xing!=0)
{
System.out.print("请输入等级");
ji=sc.next();
System.out.print("请输入主属性")
zhu=sc.next();
switch(xing){case 3:da=149+zhu-(17+ji)/2;break;case 4:da=149+zhu-(31+ji)/2;break;case 5:da=149+zhu-(49+ji)/2;break;}}
System.out.println(da);
}
}
已改成android版本发送到邮箱