第三次作业第三题

2018-10-25  本文已影响0人  皮皮虾_98e9

代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
/**
* 用户输入天数,并计算这个天数是几周几天。
* */
Console.WriteLine("请输入天数");
string num = Console.ReadLine();
int ll = Convert.ToInt32(num);
int hh = ll % 7;
int mm = ll / 7;
Console.WriteLine("{0}天是第{1}周零{2}天", ll, mm, hh);
Console.ReadKey();

    }
}

}

效果

IMG_0095.JPG
上一篇 下一篇

猜你喜欢

热点阅读