回复 2楼 wangnannan
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string LV = int.parse("textBox1.text ");
string VIT = int.parse("textBox2.text ");
string STR = int.parse("textBox3.text ");
string DEX = int.parse("textBox4.text ");
string AGL = int.parse("textBox5.text ");
string MAG = int.parse("textBox6.text ");
string HP = int.parse("textBox7.text ");
string MP = int.parse("textBox8.text ");
string ATK = int.parse("textBox9.text ");
string DEF = int.parse("textBox10.text ");
string INT = int.parse("textBox11.text ");
string MND = int.parse("textBox12.text ");
string ACT = int.parse("textBox13.text ");
string RCV = int.parse("textBox14.text ");
string HIT = int.parse("textBox15.text ");
string AVD = int.parse("textBox16.text ");
string LUC = int.parse("textBox17.text ");
string TEC = int.parse("textBox18.text ");
for (var i1=0;i1<5;i1++)
{for (var i2=0;i2<5;i2++)
{for (var i3=0;i3<5;i3++)
{for (var i4=0;i4<5;i4++)
{for (var i5=0;i5<5;i5++)
if(
AVD==Math.Floor((DEX+i3*0.2-0.4)*2+(AGL+i4*0.2-0.4)*2)&&
MND==Math.Floor((VIT+i1*0.2-0.4)*1+(STR+i2*0.2-0.4)*0.5+(MAG+i5*0.2-0.4)*2.5)&&
LUC==Math.Floor((DEX+i3*0.2-0.4)*2+(AGL+i4*0.2-0.4)*1.4+(MAG+i5*0.2-0.4)*0.6)&&
ACT==Math.Floor((STR+i2*0.2-0.4)*0.4+(DEX+i3*0.2-0.4)*1.6+(AGL+i4*0.2-0.4)*0.6)&&
ATK==Math.Floor((VIT+i1*0.2-0.4))*1+(STR+i2*0.2-0.4)*2.4+(DEX+i3*0.2-0.4)*0.2+(AGL+i4*0.2-0.4)*0.4)&&
DEF==Math.Floor((VIT+i1*0.2-0.4)*1.8+(STR+i2*0.2-0.4)*1.2+(DEX+i3*0.2-0.4)*0.2+(AGL+i4*0.2-0.4)*0.8)&&
HIT==Math.Floor((STR+i2*0.2-0.4)*1.4+(DEX+i3*0.2-0.4)*1.5+(AGL+i4*0.2-0.4)*0.6+(MAG+i5*0.2-0.4)*0.5)&&
RCV==Math.Floor((VIT+i1*0.2-0.4)*2.3+(STR+i2*0.2-0.4)*1.2+(AGL+i4*0.2-0.4)*0.2+(MAG+i5*0.2-0.4)*0.3)&&
HP==Math.Floor((VIT+i1*0.2-0.4)*9.3+(STR+i2*0.2-0.4)*3+(DEX+i3*0.2-0.4)*0.6+(AGL+i4*0.2-0.4)*0.6+(MAG+i5*0.2-0.4)*1.5)&&
MP==Math.Floor((VIT+i1*0.2-0.4)*9+(STR+i2*0.2-0.4)*1.5+(DEX+i3*0.2-0.4)*3+(AGL+i4*0.2-0.4)*0.6+(MAG+i5*0.2-0.4)*9)&&
INT==Math.Floor((VIT+i1*0.2-0.4)*0.2+(STR+i2*0.2-0.4)*1.2+(DEX+i3*0.2-0.4)*0.4+(AGL+i4*0.2-0.4)*0.2+(MAG+i5*0.2-0.4)*2)&&
TEC==Math.Floor((VIT+i1*0.2-0.4)*0.3+(STR+i2*0.2-0.4)*0.2+(DEX+i3*0.2-0.4)*0.9+(AGL+i4*0.2-0.4)*2+(MAG+i5*0.2-0.4)*0.6);
{
XX = combobox1.Text;
r体力 = TextBox20.Text = Convert.ToString(VIT+i1*0.2-0.4);
r力量 = TextBox21.Text = Convert.ToString(STR+i2*0.2-0.4);
r灵巧 = TextBox22.Text = Convert.ToString(DEX+i3*0.2-0.4);
r速度 = TextBox23.Text = Convert.ToString(AGL+i4*0.2-0.4);
r精神 = TextBox24.Text = Convert.ToString(MAG+i5*0.2-0.4);
Takkun = TextBox19 = (XX*2+2-(r体力+r力量+r灵巧+r速度+r精神))/0.2;
}
}}}}}
}
}
}
初学VS08 里面的等式还有待进一步学习后更改为正确的代码呢没找到截图就把图片上传附件了
图片附件: 游客没有浏览图片的权限,请
登录 或
注册
[
本帖最后由 espressocis 于 2014-1-15 15:40 编辑 ]