20181025作业

…
作业1
…


图片发自简书App

…
代码
…
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();
    }
}

}

…
效果

…
图片发自简书App

…
作业2
…


图片发自简书App

…
代码
…
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();
    }
}

}

…
效果
…


图片发自简书App

…
作业3
…


图片发自简书App

…
代码
…
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();

    }
}

}

…
效果
…


图片发自简书App

…

最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容