2018-10-25作业2(1)

using System;

using System.Collections.Generic;

 using System.Linq;

 using System.Text;

 namespace 作业2

 {

class Program

{

static void Main(string[] args)

{

 Console.WriteLine("请输入你的名字");

 string name = Console.ReadLine();

 Console.WriteLine("请输入你的语文成绩");

string strchinese = Console.ReadLine();

double chinese = Convert.ToDouble(strchinese);

Console.WriteLine("请输入你的数学成绩");

 string strmath = Console.ReadLine();

double math = Convert.ToDouble(strmath);

 Console.WriteLine("请输入你的英语成绩");

 string strenglish = Console.ReadLine();

double english = Convert.ToDouble(strenglish);

int Chinese = Convert.ToInt32(chinese);

int Math = Convert.ToInt32(math);

int English = Convert.ToInt32(english);

 int total = Math + Chinese + English;

int avg = total / 3;

 Console.WriteLine("姓名:{0},你的总成绩为:{1},平均成绩为{2};", name, total, avg);

Console.ReadKey();

}

}

 }

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 代码 using System;using System.Collections.Generic;using Sy...
    皮皮虾_98e9阅读 187评论 0 0
  • #代码 using System; using System.Collections.Generic; using...
    柏建春阅读 175评论 0 0
  • 知识点: 注:int类型默认32位有大小范围 且第一位为符号位 0 为正 1 为负 8.4作业 A:1、风力预警系...
    cGunsNRoses阅读 1,128评论 0 0
  • using System; using System.Collections.Generic; using Sys...
    追魂_409e阅读 144评论 0 0
  • 歌词:嫁到鄂尔多斯来 远心 你是我的斡尔朵 在你的大帐里跳舞唱歌 吸引世界的璀璨星河 你是我的鄂尔多斯 一首纯正的...
    远心笃行阅读 688评论 0 2