运行打不了中文!没有最后的结果!求高手
using System;using System.Collections.Generic;
using System.Text;
namespace Wage
{
struct gz //定义职工工资结构体类型gz
{
public int num; //职工编号
public string name; //姓名
public int jbgz; //基本工资
public int jj; //奖金
public int tc; //提成
public int ydgz; //基本工资
}
class Program
{
static void Main(string[] args)
{
gz[] s = new gz[4]; //定义工资结构体数组
int i,j,zggz,zdgz;
float zgz,pjgz;
zgz=0; //总工资初始化
zggz=0; //最高工资初始化
zdgz=65535; //最低工资初始化
i = 0; //数组下标初始化
Console.WriteLine(" 职工工资统计\n");
do
{
Console.Write("编号:");
s[i].num = Convert.ToInt16(Console.ReadLine()); //引用结构成员, 输入信息
Console.Write("姓名:");
s[i].name = Console.ReadLine();
Console.Write("基本工资:");
s[i].jbgz = Convert.ToInt16(Console.ReadLine());
Console.Write("奖金:");
s[i].jj = Convert.ToInt16(Console.ReadLine());
Console.Write("提成:");
s[i].tc = Convert.ToInt16(Console.ReadLine());
s[i].ydgz = s[i].jbgz+s[i].jj + s[i].tc; //计算实发工资
i++;
} while (i < s.Length);
for (j = 0; j < s.Length; j++)
{
zgz = zgz + s[j].ydgz; //计算总工资
if (zgz < s[j].ydgz) //查找最高工资
zgz = s[j].ydgz;
if (zgz > s[j].ydgz) //查找最低工资
zgz = s[j].ydgz;
}
pjgz = (float)(zgz / i);
//输入统计信息
Console.WriteLine("\n-------------------------------------------------\n");
Console.WriteLine(" 编号 姓名 基本工资 奖金 提成 实发工资 \n");
for (j = 0; j < s.Length; j++)
{
Console.WriteLine("{0,6} {1,6} {2,6} {3,6} {4,6} {5,6}", s[j].num, s[j].name, s[j].jbgz, s[j].jj, s[j].tc, s[j].ydgz);
}
Console.WriteLine("职工总工资为{0},平均工资为{1}\n", zgz, pjgz);
Console.WriteLine("最高工资为{0},最低工资{1}", zggz, zdgz);
Console.ReadLine();
}
}
}