using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test
{
class Survey
{
static void Main()
{
Console.WriteLine(“1.求1加到5的加法”);
int j = 1;
int result = 0;
for (int i = 1; j < 5; j++)
{
result = i + j;
Console.Write(i+"+"+j+"="+result+";");
}
Console.ReadLine();
下面是输出截图:
xx:
Console.WriteLine(“2.求甲比乙少几分之几”);
Console.WriteLine(“输入一个正数甲:”);
decimal a = decimal.Parse(Console.ReadLine());
Console.WriteLine(“再输入一个不等于甲的正数乙:”);
decimal b = decimal.Parse(Console.ReadLine());
decimal c = (b - a) / b;
int d = Convert.ToInt32(c * 10);
Console.WriteLine(“答:甲比乙少” + d + “/10”);
Console.ReadLine();
goto xx;
}
}
下面是输出截图: