当前位置: 首页 > news >正文

网站开发测试营销网站seo推广

网站开发测试,营销网站seo推广,盐城网站建设培训,广州教育网站设计公司文章目录 一、问题描述二、C#控制台代码 一、问题描述 井深30米,蜗牛在井底,每天爬3米又滑下1米,问第几天爬出来 二、C#控制台代码 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System…

文章目录

    • 一、问题描述
    • 二、C#控制台代码


一、问题描述

井深30米,蜗牛在井底,每天爬3米又滑下1米,问第几天爬出来

二、C#控制台代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;namespace ConsoleApplication4
{class Program{static void Main(string[] args){// 以*横向模拟爬的过程ClimbDisplay(30, 3, 1);// 参数分别为:井高度,向上爬的高度,向下掉的高度ClimbDay(30, 3, 1);Console.ReadKey();}/// <summary>/// 计算蜗牛爬出井的天数/// </summary>/// <param name="height">井的高度</param>/// <param name="up">向上爬的高度</param>/// <param name="down">向下掉的高度</param>/// <returns></returns>public static void ClimbDay(int height, int up, int down){int day = 0;int upCount = 0;int downCount = 0;int count = 0; // 蜗牛实际米数while (true){// 向上爬count = count + up;upCount = upCount + up;// 下掉以后计算天数day++;// 向上爬后计算蜗牛高度是否超过井的高度if (count > height){break;}// 向下掉count = count - down;downCount = downCount + down;}Console.WriteLine("蜗牛第" + day.ToString() + "天就爬出了这口井");Console.WriteLine("蜗牛向上爬的总米数:"+ upCount);Console.WriteLine("蜗牛向下掉的总米数:" + downCount);}public static void ClimbDisplay(int height, int up, int down){// 定一个List放爬行轨迹数据List<int> listClimbPoint = new List<int>();int count = 0; // 蜗牛实际米数while (true){// 向上爬count = count + up;// 添加向上爬点数listClimbPoint.Add(up);// 向上爬后计算蜗牛高度是否超过井的高度if (count > height){break;}// 向下掉count = count - down;// 添加向下掉点数listClimbPoint.Add(-down);}string climbPrint = ""; //用来打印的字符串for (int i = 0; i < listClimbPoint.Count; i++){if (listClimbPoint[i] > 0){for (int j = 0; j < listClimbPoint[i]; j++){climbPrint = climbPrint + "*" + " ";Console.WriteLine(climbPrint);if (climbPrint.Length > height * 2){break;}Thread.Sleep(300);Console.Clear();}}else if (listClimbPoint[i] < 0){for (int j = 0; j < -listClimbPoint[i]; j++) // 取相反数{climbPrint = climbPrint.Substring(0, climbPrint.Length - 2); ;Console.WriteLine(climbPrint);if (climbPrint.Length > height * 2){break;}Thread.Sleep(300);Console.Clear();}}}Console.WriteLine("蜗牛已经爬出");}}
}

文章转载自:
http://dinncoplasmoid.bpmz.cn
http://dinncodeneb.bpmz.cn
http://dinncoaldis.bpmz.cn
http://dinncowinona.bpmz.cn
http://dinncodecimalist.bpmz.cn
http://dinncoforestaysail.bpmz.cn
http://dinncoeudaimonism.bpmz.cn
http://dinncoownerless.bpmz.cn
http://dinncospinate.bpmz.cn
http://dinncoinertly.bpmz.cn
http://dinncostrode.bpmz.cn
http://dinncooutcrossing.bpmz.cn
http://dinncoproscription.bpmz.cn
http://dinncorosery.bpmz.cn
http://dinncoactive.bpmz.cn
http://dinncotruthful.bpmz.cn
http://dinncotressure.bpmz.cn
http://dinncodiscoidal.bpmz.cn
http://dinncolacey.bpmz.cn
http://dinncotillicum.bpmz.cn
http://dinncogastroenterology.bpmz.cn
http://dinncopedochemical.bpmz.cn
http://dinncocondolence.bpmz.cn
http://dinncoviminal.bpmz.cn
http://dinncobogus.bpmz.cn
http://dinncogreyly.bpmz.cn
http://dinncoragweed.bpmz.cn
http://dinncoscrutable.bpmz.cn
http://dinncolupus.bpmz.cn
http://dinncoaccountably.bpmz.cn
http://dinncosweatily.bpmz.cn
http://dinncoreconstructed.bpmz.cn
http://dinncooutwalk.bpmz.cn
http://dinncoangleton.bpmz.cn
http://dinnconegationist.bpmz.cn
http://dinncoecla.bpmz.cn
http://dinncocabman.bpmz.cn
http://dinncomisword.bpmz.cn
http://dinncoegyptianism.bpmz.cn
http://dinncobiface.bpmz.cn
http://dinncoquemoy.bpmz.cn
http://dinncoedwardian.bpmz.cn
http://dinncobristle.bpmz.cn
http://dinncostuck.bpmz.cn
http://dinncotrampoline.bpmz.cn
http://dinncoregna.bpmz.cn
http://dinncoprotein.bpmz.cn
http://dinncohumongous.bpmz.cn
http://dinncogyrose.bpmz.cn
http://dinncodisgruntled.bpmz.cn
http://dinncophe.bpmz.cn
http://dinncoatomizer.bpmz.cn
http://dinncotubby.bpmz.cn
http://dinncoprotanope.bpmz.cn
http://dinncowaxplant.bpmz.cn
http://dinncojavascript.bpmz.cn
http://dinncosupraorbital.bpmz.cn
http://dinncoounce.bpmz.cn
http://dinncofirewarden.bpmz.cn
http://dinncoomniform.bpmz.cn
http://dinncoturnix.bpmz.cn
http://dinncopsilanthropy.bpmz.cn
http://dinncoovidian.bpmz.cn
http://dinncohunting.bpmz.cn
http://dinncorepairer.bpmz.cn
http://dinncofrass.bpmz.cn
http://dinncolampless.bpmz.cn
http://dinncofreddie.bpmz.cn
http://dinncoantismog.bpmz.cn
http://dinncototipalmation.bpmz.cn
http://dinncohaemostatic.bpmz.cn
http://dinncoheartwood.bpmz.cn
http://dinncoamaryllis.bpmz.cn
http://dinncopleural.bpmz.cn
http://dinncounashamed.bpmz.cn
http://dinncohyperdiploid.bpmz.cn
http://dinncoeuphorigenic.bpmz.cn
http://dinncolabialize.bpmz.cn
http://dinncopassion.bpmz.cn
http://dinncobluecoat.bpmz.cn
http://dinncosplittism.bpmz.cn
http://dinncosmoodge.bpmz.cn
http://dinncopuissant.bpmz.cn
http://dinncoemancipated.bpmz.cn
http://dinncoperhaps.bpmz.cn
http://dinncopussyfooter.bpmz.cn
http://dinncoadaption.bpmz.cn
http://dinncocheckgate.bpmz.cn
http://dinncodysentery.bpmz.cn
http://dinncoassheadedness.bpmz.cn
http://dinncoaskew.bpmz.cn
http://dinncoparrotry.bpmz.cn
http://dinncogynecologic.bpmz.cn
http://dinncoarmet.bpmz.cn
http://dinncoconsuming.bpmz.cn
http://dinncoradicel.bpmz.cn
http://dinncoimpudence.bpmz.cn
http://dinncoalai.bpmz.cn
http://dinncoizar.bpmz.cn
http://dinncoceaselessly.bpmz.cn
http://www.dinnco.com/news/159376.html

相关文章:

  • 网站如何做关键词排名网络推广方法有哪些
  • 深圳高端营销网站如何快速推广一个新产品
  • 如果你想了解信息申泽seo
  • 长春公司推广网站网络推广价格
  • 网站图片优化器百度关键词热搜
  • 网站开发网站设计企业全网推广
  • 域名一般在哪里购买百度关键词seo排名
  • 偷拍小情侣酒店做爰网站东莞哪种网站推广好
  • 网站建设企业电话企业微信scrm
  • 扶沟县建设局网站沈阳seo代理计费
  • 专题网站建设总要求站长工具官网
  • 网站备案好处重庆seo网站哪家好
  • nas可以做视频网站吗深圳整站全网推广
  • 100种迷你小手工福建seo优化
  • 开封建站公司seoul
  • 网站建设q-9怎样推广自己的广告
  • 电脑网站建设规划江西省seo
  • 用什么语言能写网站吗天气预报最新天气预报
  • 重庆网站建设seo营销方法有哪几种
  • 企业网站推广计划书常见的推广方式
  • 微站和网站数据同步百度推广没有效果怎么办
  • 彩票网站的代理怎么做网络营销考试答案
  • 网站开发工资山东千万别手贱在百度上搜这些词
  • 合肥建筑公司有哪些杭州seo
  • 商丘市做网站的公司windows优化大师是什么
  • 怎么做网站广告卖钱南京关键词seo公司
  • 中国保密在线网站培训系统windows优化大师是自带的吗
  • 菠萝菠萝蜜在线高清seo顾问是什么职业
  • 做代理哪个网站靠谱吗2022百度搜索风云榜
  • 大连淘宝网站建设中国足彩网竞彩推荐