<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[Sandwith的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/Sandwith</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; Sandwith]]></copyright><item><title><![CDATA[【C】手机]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/115186746</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/115186746</guid><author>Sandwith</author><pubDate>Wed, 24 Mar 2021 20:34:09 +0800</pubDate><description><![CDATA[手机
题目描述
一般的手机的键盘是这样的：

要按出英文字母就必须要按数字键多下。例如要按出 x 就得按 9 两下，第一下会出 w，而第二下会把 w 变成 x。0 键按一下会出一个空格。
你的任务是读取若干句只包含英文小写字母和空格的句子，求出要在手机上打出这个句子至少需要按多少下键盘。
输入格式
一行句子，只包含英文小写字母和空格，且不超过 200 个字符。
输出格式
一行一个整数，表示按键盘的总次数。
输入输出样例
输入 #1
i have a dream
输出 #1
23
#include &lt;s]]></description><category></category></item><item><title><![CDATA[【C++】闰年展示]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/115094818</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/115094818</guid><author>Sandwith</author><pubDate>Mon, 22 Mar 2021 20:00:45 +0800</pubDate><description><![CDATA[闰年展示
题目描述
输入
x,y(1582≤x&lt;y≤3000) ，输出 [x,y] 区间中闰年个数，并在下一行输出所有闰年年份数字，使用空格隔开。
输入格式
无
输出格式
无
输入输出样例
输入 #1
1989 2001
输出 #1
3
1992 1996 2000
#include&lt;bits/stdc++.h&gt;
using namespace std;

bool isrunyear(int n){
	if(n%4!=0)return 0;
	else{
		if(n%100==0){
]]></description><category></category></item><item><title><![CDATA[【C++】Davor]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114778375</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114778375</guid><author>Sandwith</author><pubDate>Sun, 14 Mar 2021 10:39:16 +0800</pubDate><description><![CDATA[Davor
题目描述
After successfully conquering the South Pole, Davor is preparing for new challenges. Next up is the Arctic expedition to Siberia, Greenland and Norway. He begins his travels on 31 December 2018, and needs to collect ​N kunas (Croatian currency) ]]></description><category></category></item><item><title><![CDATA[【C语言】数字反转]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114743410</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114743410</guid><author>Sandwith</author><pubDate>Sat, 13 Mar 2021 13:17:47 +0800</pubDate><description><![CDATA[数字反转
题目描述
给定一个整数，请将该数各个位上数字反转得到一个新数。新数也应满足整数的常见形式，即除非给定的原数为零，否则反转后得到的新数的最高位数字不应为零（参见样例2）。
输入格式
一个整数 N
输出格式
一个整数，表示反转后的新数。
输入输出样例
输入 #1
123
输出 #1
321
输入 #2
380
输出 #2
83
#include&lt;stdio.h&gt;
#include&lt;string.h&gt;
char a[11]={};
int b;
int main()
{
  ge]]></description><category></category></item><item><title><![CDATA[【C语言】月落乌啼算钱（斐波那契数列）]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114631309</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114631309</guid><author>Sandwith</author><pubDate>Wed, 10 Mar 2021 11:36:31 +0800</pubDate><description><![CDATA[月落乌啼算钱（斐波那契数列）
题目背景
吃完 pizza，月落乌啼知道超出自己的预算了。为了不在爱与愁大神面前献丑，只好还是硬着头皮去算钱……
题目描述
算完钱后，月落乌啼想着：“你 TMD 坑我，（以下用闽南语读）归粒靠杯靠亩诶，（以下用英读）是伊特游！”于是当爱与愁大神问多少钱时，月落乌啼说了一堆乱码。爱与愁大神说：“算了算了，我只问第n样菜价格多少？”月落乌啼写出了：
由于爱与愁大神学过编程，于是就用 1 分钟的时间求出了 Fn的结果。月落乌啼为此大吃一惊。你能学学爱与愁大神求出 Fn的值吗？
输入格]]></description><category></category></item><item><title><![CDATA[【C++】数字直角三角形]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114630777</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114630777</guid><author>Sandwith</author><pubDate>Wed, 10 Mar 2021 11:18:23 +0800</pubDate><description><![CDATA[数字直角三角形
题目描述
给出n(1≤n≤13)，请输出一个直角边长度是 n 的数字直角三角形。所有数字都是 2 位组成的，如果没有 2 位则加上前导 0。
输入格式
无
输出格式
无
输入输出样例
输入 #1
5
输出 #1
0102030405
06070809
101112
1314
15
#include&lt;cstdio&gt;
using namespace std;
int main()
{
	int n;
	scanf("%d",&amp;n);
	int cnt=0; 
	for(int]]></description><category></category></item><item><title><![CDATA[【C语言】分类平均]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114630533</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114630533</guid><author>Sandwith</author><pubDate>Wed, 10 Mar 2021 11:12:08 +0800</pubDate><description><![CDATA[分类平均
题目描述
给定 n(n≤10000) 和 k(k≤100)，将从 1 到 n 之间的所有正整数可以分为两类：A 类数可以被 k 整除（也就是说是 k 的倍数），而 B 类数不能。请输出这两类数的平均数，精确到小数点后 1 位，用空格隔开。
数据保证两类数的个数都不会是 0。
输入格式
无
输出格式
无
输入输出样例
输入 #1
100 16
输出 #1
56.0 50.1
#include&lt;stdio.h&gt;
int main()
{
    int n,k;
    int i;
  ]]></description><category></category></item><item><title><![CDATA[【C++】ISBN号码]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114597404</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114597404</guid><author>Sandwith</author><pubDate>Tue, 09 Mar 2021 19:51:24 +0800</pubDate><description><![CDATA[ISBN号码
题目描述
每一本正式出版的图书都有一个ISBN号码与之对应，ISBN码包括9位数字、1位识别码和3位分隔符，其规定格式如x-xxx-xxxxx-x，其中符号-就是分隔符（键盘上的减号），最后一位是识别码，例如0-670-82162-4就是一个标准的ISBN码。ISBN码的首位数字表示书籍的出版语言，例如0代表英语；第一个分隔符-之后的三位数字代表出版社，例如670代表维京出版社；第二个分隔符后的五位数字代表该书在该出版社的编号；最后一位为识别码。
识别码的计算方法如下：
首位数字乘以1加上次位]]></description><category></category></item><item><title><![CDATA[【C语言】ABC]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114596818</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114596818</guid><author>Sandwith</author><pubDate>Tue, 09 Mar 2021 19:37:48 +0800</pubDate><description><![CDATA[ABC
题目描述
You will be given three integers A, B and C. The numbers will not be given in that exact order, but we do know that A is less than B and B less than C. In order to make for a more pleasant viewing, we want to rearrange them in the given order.
输入格]]></description><category></category></item><item><title><![CDATA[【C++】打分]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114591742</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114591742</guid><author>Sandwith</author><pubDate>Tue, 09 Mar 2021 17:39:14 +0800</pubDate><description><![CDATA[打分
题目描述
现在有 n(n≤1000) 位评委给选手打分，分值从 0 到 10。需要去掉一个最高分，去掉一个最低分（如果有多个最高或者最低分，也只需要去掉一个），剩下的评分的平均数就是这位选手的得分。现在输入评委人数和他们的打分，请输出选手的最后得分，精确到 2 位小数。
输入格式
无
输出格式
无
输入输出样例
输入 #1
5
9 5 6 8 9
输出 #1
7.67
#include&lt;bits/stdc++.h&gt;
using namespace std;
int main(){
    ]]></description><category></category></item><item><title><![CDATA[刷题路-杨辉三角]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114590830</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114590830</guid><author>Sandwith</author><pubDate>Tue, 09 Mar 2021 17:22:35 +0800</pubDate><description><![CDATA[杨辉三角
题目描述
给出 n(n≤20)，输出杨辉三角的前 n 行。
如果你不知道什么是杨辉三角，可以观察样例找找规律。
输入格式
无
输出格式
无
输入输出样例
输入 #1
6
输出 #1
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
#include&lt;stdio.h&gt;
int a[21][21];
int main()
{
	int n;
	scanf("%d",&amp;n);
	for(int i=1;i&lt;=n;i++)
		a[i][1]]]></description><category></category></item><item><title><![CDATA[刷题路-小玉在游泳]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114544808</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114544808</guid><author>Sandwith</author><pubDate>Mon, 08 Mar 2021 19:20:59 +0800</pubDate><description><![CDATA[小玉在游泳
这名字就离谱。
题目描述
小玉开心的在游泳，可是她很快难过的发现，自己的力气不够，游泳好累哦。已知小玉第一步能游2米，可是随着越来越累，力气越来越小，她接下来的每一步都只能游出上一步距离的98%。现在小玉想知道，如果要游到距离x米的地方，她需要游多少步呢。请你编程解决这个问题。
输入格式
输入一个数字（不一定是整数，小于100m），表示要游的目标距离。
输出格式
输出一个整数，表示小玉一共需要游多少步。
输入输出样例
输入 #1
4.3
输出 #1
3

#include&lt;stdio.h&]]></description><category></category></item><item><title><![CDATA[刷题路-金币]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114499763</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114499763</guid><author>Sandwith</author><pubDate>Sun, 07 Mar 2021 21:47:46 +0800</pubDate><description><![CDATA[金币
题目描述
国王将金币作为工资，发放给忠诚的骑士。第一天，骑士收到一枚金币；之后两天（第二天和第三天），每天收到两枚金币；之后三天（第四、五、六天），每天收到三枚金币；之后四天（第七、八、九、十天），每天收到四枚金币……；这种工资发放模式会一直这样延续下去：当连续N天每天收到N枚金币后，骑士会在之后的连续N+1天里，每天收到N+1枚金币。
请计算在前K天里，骑士一共获得了多少金币。
输入格式
一个正整数K，表示发放金币的天数。
输出格式
一个正整数，即骑士收到的金币数。
输入输出样例
输入 #1
6
输]]></description><category></category></item><item><title><![CDATA[刷题路-传纸条（C语言）]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114480244</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114480244</guid><author>Sandwith</author><pubDate>Sun, 07 Mar 2021 11:16:29 +0800</pubDate><description><![CDATA[传纸条
题目描述
小渊和小轩是好朋友也是同班同学，他们在一起总有谈不完的话题。一次素质拓展活动中，班上同学安排做成一个 m 行 n 列的矩阵，而小渊和小轩被安排在矩阵对角线的两端，因此，他们就无法直接交谈了。幸运的是，他们可以通过传纸条来进行交流。纸条要经由许多同学传到对方手里，小渊坐在矩阵的左上角，坐标 (1,1)，小轩坐在矩阵的右下角，坐标 (m,n)。从小渊传到小轩的纸条只可以向下或者向右传递，从小轩传给小渊的纸条只可以向上或者向左传递。
在活动进行中，小渊希望给小轩传递一张纸条，同时希望小轩给他回复]]></description><category></category></item><item><title><![CDATA[刷题路-小鱼的航程]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114480112</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114480112</guid><author>Sandwith</author><pubDate>Sun, 07 Mar 2021 11:09:53 +0800</pubDate><description><![CDATA[小鱼的航程
题目背景
原来的题目太简单，现改进让小鱼周末也休息，请已经做过重做该题。
题目描述
有一只小鱼，它平日每天游泳 250 公里，周末休息（实行双休日)，假设从周 x(1≤x≤7) 开始算起，过了 n(n≤10ˇ6 ) 天以后，小鱼一共累计游泳了多少公里呢？
输入格式
输入两个整数x,n(表示从周x算起，经过n天）。
输出格式
输出一个整数，表示小鱼累计游泳了多少公里。
输入输出样例
输入 #1
3 10
输出 #1
2000
#include &lt;stdio.h&gt;
int main(){]]></description><category></category></item><item><title><![CDATA[刷题路-距离函数]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114447972</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114447972</guid><author>Sandwith</author><pubDate>Sat, 06 Mar 2021 17:14:43 +0800</pubDate><description><![CDATA[距离函数
题目描述
给出平面坐标上不在一条直线上三个点坐标 (x1,y1),(x2,y2),(x3,y3)，坐标值是实数，且的绝对值不超过 100.00，求围成的三角形周长。保留两位小数。
输入格式
无
输出格式
无
输入输出样例
输入 #1
0 0 0 3 4 0
输出 #1
12.00
#include&lt;stdio.h&gt;
#include&lt;math.h&gt;
int main()
{
    float x1,x2,x3,y1,y2,y3;
    float whole;
    ]]></description><category></category></item><item><title><![CDATA[刷题路-求三角形]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114390345</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114390345</guid><author>Sandwith</author><pubDate>Fri, 05 Mar 2021 12:37:15 +0800</pubDate><description><![CDATA[求三角形
题目描述
模仿例题，打印出不同方向的正方形，然后打印三角形矩阵。中间有个空行。
输入格式
输入矩阵的规模，不超过 9。
输出格式
输出矩形和正方形
输入输出样例
输入 #1
4
输出 #1

01020304
05060708
09101112
13141516
01
0203
040506
07080910

#include&lt;bits/stdc++.h&gt;//万能头文件好 
using namespace std;
int main(){
	int n,i,j,wei=0,weii,]]></description><category></category></item><item><title><![CDATA[刷题路-级数求和]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114330051</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114330051</guid><author>Sandwith</author><pubDate>Wed, 03 Mar 2021 19:15:21 +0800</pubDate><description><![CDATA[级数求和
题目描述
已知：Sn=1+1/2+1/3+…+1/n。显然对于任意一个整数k，当 n 足够大的时候，Sn&gt;k。
现给出一个整数 k，要求计算出一个最小的 n，使得Sn&gt;k。
输入格式
一个正整数 k。
输出格式
一个正整数 n。
输入输出样例
输入 #1
1
输出 #1
2
#include&lt;stdio.h&gt;
int main()
{
    int k,n;
    double sn=0.0;
    scanf("%d",&amp;k);
    for(n=1;;n]]></description><category></category></item><item><title><![CDATA[刷题路-阶乘之和]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114310228</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114310228</guid><author>Sandwith</author><pubDate>Wed, 03 Mar 2021 13:45:55 +0800</pubDate><description><![CDATA[阶乘之和
题目描述
用高精度计算出 S = 1! + 2! + 3! + ～ + n!（n≤50）。
其中“!”表示阶乘，例如：5!=5×4×3×2×1。
输入格式
一个正整数 n。
输出格式
一个正整数 S，表示计算结果。
输入输出样例
输入 #1
3
输出 #1
9
说明/提示
【数据范围】
对于 100% 的数据，1≤n≤50。
《简洁》
#include&lt;stdio.h&gt;
int main()
{
    int i,A[1005]={0},B[1005]={0},n,j;
    sc]]></description><category></category></item><item><title><![CDATA[刷题路-求极差]]></title><link>https://blog.youkuaiyun.com/Sandwith/article/details/114290357</link><guid>https://blog.youkuaiyun.com/Sandwith/article/details/114290357</guid><author>Sandwith</author><pubDate>Tue, 02 Mar 2021 17:37:18 +0800</pubDate><description><![CDATA[求极差
题目描述
给出 n(n≤100) 和 n 个整数 (0≤i≤100)，求这 n 个整数中的极差是什么。极差的意思是一组数中的最大值减去最小值的差。
输入格式
无
输出格式
无
输入输出样例
输入 #1
6
1 1 4 5 1 4
输出 #1
4
#include&lt;bits/stdc++.h&gt;
using namespace std;

int main(){
	int n,maxn=-1,minn=1001;
	cin&gt;&gt;n;
	for(int i=1;i&lt;=n;++i]]></description><category></category></item></channel></rss>