?? form1.cs
字號:
?using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace FIFO
{
public partial class Form1 : Form
{
int fi_i = 0;
int fi_type1 = 0;
int fi_i1 = 0;
int fi_i2 = 0;
int fi_i3 = 0;
Label[] a = new Label[5];
int[] fi_ii = new int[5];
public Form1()
{
InitializeComponent();
chushihua();
suijishu();
timer1.Enabled = true;
}
public void suijishu()
{
Random r1 = new Random();
fi_i = r1.Next(1, 30);
}
public void panduan11(int a, int b, int c)//一一全部調入后再一一執行!
{
if (4 * (a++) < 328)
{
fi_type1 = 1;
label4.Text = "CPU正在調入進程1";
}
else
if (4 * (a++) < 556)
{
if (3 * (b++) < 328)
{
fi_type1 = 2;
label4.Text = "CPU正在調入進程2.";
}
else
{
if (3 * (b++) < 556)
{
if (2 * (c++) < 328)
{
fi_type1 = 3;
label4.Text = "CPU正在調入進程3";
}
else
{
if (2 * (c++) < 556)
{
fi_type1 = 1;
label4.Text = "CPU正在運行進程1";
}
}
}
else
{
fi_type1 = 3;
label4.Text = "CPU正在調入進程3";
}
}
}
else
if (3 * (b++) < 556)
{
fi_type1 = 2;
label4.Text = "CPU正在運行進程2";
}
else
if (2 * (c++) < 556)
{
fi_type1 = 3;
label4.Text = "CPU正在運行進程3";
}
else
{
fi_type1 = 7;
label4.Text = "結束!";
}
}
public void panduan12(int a, int b, int c)//調入一個就執行一個!
{
if (4 * (a++) < 556)
{
if (4 * (a++) < 328)
{
fi_type1 = 1;
label4.Text = "CPU正在調入進程1";
}
else
{
fi_type1 = 1;
label4.Text = "CPU正在運行進程1";
}
}
else
if (3 * (b++) < 556)
{
if (3 * (b++) < 328)
{
fi_type1 = 2;
label4.Text = "CPU正在調入進程2";
}
else
{
fi_type1 = 2;
label4.Text = "CPU正在運行進程2";
}
}
else
{
if (2 * (c++) < 556)
{
if (2 * (c++) < 328)
{
fi_type1 = 3;
label4.Text = "CPU正在調入進程3";
}
else
{
fi_type1 = 3;
label4.Text = "CPU正在調運行進程3";
}
}
else
{
fi_type1 = 7;
label4.Text = "結束!";
}
}
}
public void panduan13(int a, int b, int c)
{
if (4 * (a++) < 556)
{
if (4 * (a++) < 328)
{
fi_type1 = 1;
label4.Text = "CPU正在調入進程1";
}
else
{
if (3 * (b++) < 328)
{
fi_type1 = 2;
label4.Text = "CPU正在調入進程2";
}
else
{
fi_type1 = 1;
label4.Text = "CPU正在運行進程1";
}
}
}
else
{
if (3 * (b++) < 556)
{
if (2 * (c++) < 328)
{
fi_type1 = 3;
label4.Text = "CPU正在調入進程3";
}
else
{
fi_type1 = 2;
label4.Text = "CPU正在運行進程2";
}
}
else
{
if (2 * (c++) < 556)
{
fi_type1 = 3;
label4.Text = "CPU正在運行進程3";
}
else
{
fi_type1 = 7;
label4.Text = "結束!";
}
}
}
}
public void panduan14(int a, int b, int c)
{
if (4 * (a++) < 556)
{
if (4 * (a++) < 328)
{
fi_type1 = 1;
label4.Text = "CPU正在調入進程1";
}
else
{
fi_type1 = 1;
label4.Text = "CPU正在運行進程1";
}
}
else
{
if (3 * (b++) < 556)
{
if (3 * (b++) < 328)
{
if (2 * (c++) < 328)
{
fi_type1 = 2;
label4.Text = "CPU正在調入進程2";
}
}
else
{
if (3 * (b++) < 556)
{
if (2 * (c++) < 328)
{
fi_type1 = 3;
label4.Text = "CPU正在調入進程3";
}
else
{
if (2 * (c++) < 556)
{
fi_type1 = 2;
label4.Text = "CPU正在運行進程2";
}
}
}
else
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -