第二次作业
2.GIT用户名:AngelSum233
3.学号后五位:62605
4.博客地址:https://www.cnblogs.com/AngelSum/
5.作业链接:https://i.cnblogs.com/EditPosts.aspx?opt=1
一.配置环境
vs之前已经安装好了
二.克隆项目
在 给的网址处申请注册一个 Github 账号,申请成功后进行登录。然后点开阿超的库的网址进行复制。
然后fork成功后
点击给的链接安装git 并开始在一个文件夹下进行clone
并把自己的名字和邮箱输进去
建立一个文件夹
三.设计四则运算
开始知道要用随机数但忘了用法,然后百度到了。最后简单的设计了一个算法。
后来观察老师给的要求发现至少要三四个运算符,想着还有点恼火,因为还涉及着分数的问题,百度看了别人写的,有点复杂没怎么看懂
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
char[] C = new char[] { '+', '-', '*', '/' };
string s = "";
int x = 10;
Random Max = new Random(10);
long tick = DateTime.Now.Ticks;
Random Ch = new Random();
for(int i=0;i<n;i++)
{
int num1 = Max.Next(0, 100);
int num2 = Max.Next(0, 100);
int ch1 = Ch.Next(0, 4);
double result;
if (C[ch1] == '+')
result = num1 + num2;
else if (C[ch1] == '-')
result = num1 - num2;
else if (C[ch1] == '*')
result = num1 * num2;
else
{
result = (double)num1 / (double)num2;
}
Console.WriteLine(num1.ToString() + C[ch1].ToString() + num2.ToString()+"=" + result.ToString());
}
}
}
}
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
char[] C = new char[] { '+', '-', '*', '/' };
string s = "";
int x = 10;
Random Max = new Random(10);
long tick = DateTime.Now.Ticks;
Random Ch = new Random();
for(int i=0;i<n;i++)
{
int num1 = Max.Next(0, 100);
int num2 = Max.Next(0, 100);
int ch1 = Ch.Next(0, 4);
double result;
if (C[ch1] == '+')
result = num1 + num2;
else if (C[ch1] == '-')
result = num1 - num2;
else if (C[ch1] == '*')
result = num1 * num2;
else
{
result = (double)num1 / (double)num2;
}
Console.WriteLine(num1.ToString() + C[ch1].ToString() + num2.ToString()+"=" + result.ToString());
}
}
}
}
四.单元测试
新建项目 然后有个测试 单元测试 创建好后
再测试全部即可
然后又进行调试
设置断点(按要求把文件设置为启动项目)
开始一直没找到自动窗口
后来百度把它调出来了 然后又进行监视
修改值
回归测试我是又做了一次单元测试
然后使用效能工具
cpu占用
五.上传代码
最后一张图是之前的
最后又做了一遍也有这个窗格
但是就是传不上
百度了好久按照她的办法也是不行
六.心得体会
感觉刚接触这个软件有点懵好多不懂的
后边一直改一直百度好像懂了一点这个软件的用途,我感觉它应该很适合团队做事的时候用吧。因为可以相互交流和远程连接
但是有的东西百度也没看懂
还是不明白为什么一直会有这个
然后我再git add . 就没了
嗯感觉在问别人的时候还是应该自己先努力去了解自己具体的问题,先通过自己的努力解决了不行再问。