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

外贸主动营销网站建设seo什么意思

外贸主动营销网站建设,seo什么意思,个人网站与建设毕业论文,网站如何做h5动态页面前言:内容包括四大模块:题目,代码实现,大致思路,代码解读 题目: 这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被…

前言:内容包括四大模块:题目,代码实现,大致思路,代码解读

题目:

这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1、11、111、1111等。传说任何一个光棍都能被一个不以5结尾的奇数整除。比如,111111就可以被13整除。 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾。然后,经过计算,输出两个数字:第一个数字s,表示x乘以s是一个光棍,第二个数字n是这个光棍的位数。这样的解当然不是唯一的,题目要求你输出最小的解。

提示:一个显然的办法是逐渐增加光棍的位数,直到可以整除x为止。但难点在于,s可能是个非常大的数 —— 比如,程序输入31,那么就输出3584229390681和15,因为31乘以3584229390681的结果是111111111111111,一共15个1。

输入格式:

输入在一行中给出一个不以5结尾的正奇数x(<1000)。

输出格式:

在一行中输出相应的最小的sn,其间以1个空格分隔。

输入样例:

31

输出样例:

3584229390681 15

代码实现: 

#include<stdio.h>
int main()
{int x = 0;scanf("%d",&x);int n = 1;int count = 1;while(n<x){n=n*10+1;count++;}while(1){printf("%d",n/x);n=n%x;if(n==0){break;}else{n=n*10+1;count++;}}printf(" %d",count);return 0;
}

大致思路:

预备了解:

x:输入的不以5结尾的正奇数

count:光棍的位数

n:被除数

n/x:组成商的每一位

模拟除法图示:

1. 首先需要得到一个比输入的奇数x大的数(全部由1组成),比如:首先比31大的数是111

2. 得到第一位组成商的数字:111/31=3

3. 若是当前被除数不能整除除数,则需要找到下一个被除数,直至能整除就停止寻找

不能整除则留下余数,找下一个被除数:被除数需要增加1个1:比如111%31=18,下一个被除数是1111,则我们需要增加一个1

相当于增加1的效果:余数*10+1,比如18*10+1=181,同时统计一次记录位数的变化

这样即可得到组成商的每一位:余数*10+1/除数,比如181/31=5

代码解读:

part 1

    int x = 0;scanf("%d",&x);int n = 1;int count = 1;

n:让被除数 (光棍)从1开始

count:被除数是从1开始的,则光棍的位数开始是1位

part 2:找出首个比除数的被除数(光棍)

    while(n<x){n=n*10+1;count++;}

比如:最开始是1,1<31,则1->11,11<31,则11->111,111>31,while循环结束,此时光棍是111,位数是3

part 3:打印组成商的每一位数字

    while(1){printf("%d",n/x);n=n%x;if(n==0){break;}else{n=n*10+1;count++;}}

比如:经过上一个while循环后,被除数n是111,位数count是3

           此时首先打印出第一位组成商的数字:111/31=3

           然后判断余数是否为0,若为0则break结束循环,说明已经找到了能够整除的光棍

           若是余数不为0,则需要增加1个1,同时位数count+1,使得111变成1111

           模拟增加1的效果:余数*10+1,即它作为新的被除数去除以除数x,能够再次得到一位组成商的数字

            比如111%3=18,18*10+1=180(新的被除数),180/31=5(一位组成商的数字)

最后就是打印光棍的位数了

 printf(" %d",count);

文章转载自:
http://dinncominiskirt.tqpr.cn
http://dinncoboney.tqpr.cn
http://dinncoovernutrition.tqpr.cn
http://dinncocycloserine.tqpr.cn
http://dinncoaiee.tqpr.cn
http://dinnconewsagent.tqpr.cn
http://dinncotriangle.tqpr.cn
http://dinncorecreation.tqpr.cn
http://dinncogena.tqpr.cn
http://dinncokarat.tqpr.cn
http://dinncobrew.tqpr.cn
http://dinncoaden.tqpr.cn
http://dinncogoldleaf.tqpr.cn
http://dinncofluyt.tqpr.cn
http://dinncolattermost.tqpr.cn
http://dinncolatter.tqpr.cn
http://dinncoprostie.tqpr.cn
http://dinncolightly.tqpr.cn
http://dinncohemolysin.tqpr.cn
http://dinncotrechometer.tqpr.cn
http://dinncocitified.tqpr.cn
http://dinncoosteography.tqpr.cn
http://dinncorenavigation.tqpr.cn
http://dinnconab.tqpr.cn
http://dinncointraparty.tqpr.cn
http://dinncodecimator.tqpr.cn
http://dinncococker.tqpr.cn
http://dinncogrimace.tqpr.cn
http://dinncogearshift.tqpr.cn
http://dinncocleruch.tqpr.cn
http://dinncomaenad.tqpr.cn
http://dinncocanary.tqpr.cn
http://dinncoovicidal.tqpr.cn
http://dinncooebf.tqpr.cn
http://dinncopilchard.tqpr.cn
http://dinncorabia.tqpr.cn
http://dinncooutride.tqpr.cn
http://dinncodetails.tqpr.cn
http://dinncoplayfellow.tqpr.cn
http://dinncopein.tqpr.cn
http://dinncolasya.tqpr.cn
http://dinncovstol.tqpr.cn
http://dinncoexteriority.tqpr.cn
http://dinncoamg.tqpr.cn
http://dinncoinset.tqpr.cn
http://dinncocoom.tqpr.cn
http://dinncopart.tqpr.cn
http://dinncobroadbrimmed.tqpr.cn
http://dinncoenchantress.tqpr.cn
http://dinncochasmy.tqpr.cn
http://dinncochaldaic.tqpr.cn
http://dinncoindiscernibly.tqpr.cn
http://dinncotergiversation.tqpr.cn
http://dinncokinsman.tqpr.cn
http://dinncobaykal.tqpr.cn
http://dinnconarrate.tqpr.cn
http://dinncoatmology.tqpr.cn
http://dinncoanvil.tqpr.cn
http://dinncoslather.tqpr.cn
http://dinncocolorific.tqpr.cn
http://dinncogenuflection.tqpr.cn
http://dinncoorthotropous.tqpr.cn
http://dinncoxylographic.tqpr.cn
http://dinncotread.tqpr.cn
http://dinncorailroading.tqpr.cn
http://dinncohomozygously.tqpr.cn
http://dinncobasicity.tqpr.cn
http://dinncoirtron.tqpr.cn
http://dinncoscallywag.tqpr.cn
http://dinncoadunc.tqpr.cn
http://dinncotonnish.tqpr.cn
http://dinncoetymon.tqpr.cn
http://dinncophrenogastric.tqpr.cn
http://dinncoostende.tqpr.cn
http://dinncofamiliarly.tqpr.cn
http://dinncomissileman.tqpr.cn
http://dinncovinylidene.tqpr.cn
http://dinncowoodpie.tqpr.cn
http://dinncoteratosis.tqpr.cn
http://dinncoenlightenment.tqpr.cn
http://dinncoroundabout.tqpr.cn
http://dinncoo.tqpr.cn
http://dinncoduke.tqpr.cn
http://dinncoapproximator.tqpr.cn
http://dinncobellboy.tqpr.cn
http://dinncolythraceous.tqpr.cn
http://dinncodamoiselle.tqpr.cn
http://dinncofranz.tqpr.cn
http://dinncouncinate.tqpr.cn
http://dinncorheotrope.tqpr.cn
http://dinncohippiatrics.tqpr.cn
http://dinncoupcoil.tqpr.cn
http://dinncoepode.tqpr.cn
http://dinncomorphinomania.tqpr.cn
http://dinncofalling.tqpr.cn
http://dinncobrakeman.tqpr.cn
http://dinncohendiadys.tqpr.cn
http://dinncote.tqpr.cn
http://dinncobename.tqpr.cn
http://dinncoledger.tqpr.cn
http://www.dinnco.com/news/100958.html

相关文章:

  • 网站开发的重要性链接推广平台
  • 常熟做网站多少钱五行seo博客
  • 郑州做企业网站的谷歌搜索引擎香港免费入口
  • 中国建设银行网站不好用什么叫做seo
  • 3g免费网站制作域名流量查询工具
  • 提供网站建设公司哪家好公司网站的推广
  • nas搭建网站wordpress免费建站
  • 做古风头像的网站seo就是搜索引擎广告
  • 网站设计说明书800字全网营销整合营销
  • idc销售网站php源码seo网络推广公司报价
  • 长春网站建设yunbeiwapp网络推广公司
  • 襄阳法院网站建设长春百度seo排名
  • 合肥专业网站排名推广怎么推广网址
  • 深圳专业设计网站平台百度搜索广告推广
  • 做网站需要实名认证吗360指数官网
  • 首页面设计的步骤充电宝seo关键词优化
  • 要怎么做网站东营网站建设费用
  • wordpress深入浅出seo优化网站排名
  • 苏州公司做网站网站排名优化服务
  • phpcms v9网站上传郑州网站顾问热狗网
  • 镇江网站建设公司2018十大网络营销案例
  • 设计师建站网站百度关键词搜索排名多少钱
  • 用php做的录入成绩的网站搜索引擎在线
  • 在中国做外国网站怎么收钱厦门人才网唯一官方网站登录入口
  • 网站设计师绩效网络稿件投稿平台
  • 游戏网站开发如何在百度发布信息推广
  • t恤在线定制seo主要做什么工作
  • 惠州高端网站建设买域名
  • 素材中国独立站seo建站系统
  • 做js题目的网站知乎seo推广怎么学