2018-11-29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp8
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("魔法师迷你游戏平台>游戏点击率");
int s = 0;
Console.WriteLine("请输入游戏点击的个数");
int num = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= num; i++)
{
Console.WriteLine("请输入第{0}个游戏的点击率", i);
int rate = Convert.ToInt32(Console.ReadLine());
if (rate > 100)
{
s++;
}
}
double percent = s / num ;
Console.WriteLine("点击数大于100的数有{0}个", s);
Console.WriteLine("点击率大于100的游戏所占的比例为{0}%", percent*100);
Console.ReadKey();
}
}
}