…
作业1
…
20181025作业
…
代码
…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int r = 5;
double pi = 3.14;
double perimeter=2pir;
double s = r r pi;
Console.WriteLine("半径为{0}的圆面积是{1}周长是{2}", r, s, perimeter);
Console.ReadKey();
}
}
}
…
效果
…
作业2
…
20181025作业
…
代码
…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("请输入你的姓名");
string name = Console.ReadLine();
Console.WriteLine("请输入你的语文成绩");
string str_chinese = Console.ReadLine();
int chinese = Convert.ToInt32(str_chinese);
Console.WriteLine("请输入你的数学成绩");
string str_math = Console.ReadLine();
int math = Convert.ToInt32(str_math);
Console.WriteLine("请输入你的英语成绩");
string str_english = Console.ReadLine();
int english = Convert.ToInt32(str_english);
int totol = chinese + math + english;
double average = totol / 3;
Console.WriteLine("{0},你的总成绩为{1}分,平均成绩为{2}分", name, totol, average);
Console.ReadKey();
}
}
}
…
效果
…
20181025作业
…
作业3
…
20181025作业
…
代码
…
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp9
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("天数");
int time = Convert.ToInt32(Console.ReadLine());
int week=time/7;
int day = time % 7;
Console.WriteLine("{0}是{1}周又{2}天",time,week,day);
Console.ReadKey();
}
}
}
…
效果
…
20181025作业
…
网友评论