摘要: 题目链接:https://vjudge.net/problem/UVA-1225 题意:从1排到n,统计出现数字个数 题解:不要想复杂,直接取余加就可以 极限是1e9,1e10就不可以了,但对1000绰绰有余;用count反而更慢 ac代码 #include<iostream>#include<al 阅读全文
posted @ 2020-04-09 16:56 Joelin12 阅读(121) 评论(0) 推荐(0)
摘要: 链接:https://vjudge.net/problem/UVA-1586 题意:给出一分子化学式,包含C,N,O,H四种元素,求M 题解:这是字符串题。分为几种情况:第一种是一个原子;第二种是多原子:多原子又包括字母与字母相连,字母与数字相连,数字与数字相连。思路就是看前一个原子是字母还是数字 阅读全文
posted @ 2020-04-09 16:26 Joelin12 阅读(221) 评论(0) 推荐(0)
摘要: There is an objective test result such as \OOXXOXXOOO". An `O' means a correct answer of a problemand an `X' means a wrong answer. The score of each p 阅读全文
posted @ 2020-04-09 15:37 Joelin12 阅读(503) 评论(0) 推荐(0)
摘要: 题目链接:https://vjudge.net/problem/UVA-1584 题解:用strcpy与strcmp定长比较字符串即可,strcat与strcmp对string不适用,所以只能改写为char字符串 ac代码: #include<iostream>#include<string>#in 阅读全文
posted @ 2020-04-08 16:16 Joelin12 阅读(194) 评论(0) 推荐(0)
摘要: 题目链接:https://vjudge.net/problem/UVA-1583 题意:给出一个数N,判断最小的数x使x+(x各位数字的和)=N 题解:这是一个暴力求解题,不过有技巧,x各位数字的和最多是9*位数,所以循环从N-位数*9开始循环即可 ac代码: #include<iostream># 阅读全文
posted @ 2020-04-08 15:42 Joelin12 阅读(94) 评论(0) 推荐(0)
摘要: 题目链接:https://vjudge.net/problem/UVA-340#author=0 题意:关键句子:In this problem you will be given a secret codes1: : : snand a guessg1: : : gn, and are to de 阅读全文
posted @ 2020-04-08 15:21 Joelin12 阅读(193) 评论(0) 推荐(0)
摘要: 题目链接:https://vjudge.net/problem/UVA-401 题意:判断是否为镜像串和倒序串 题解:分别判断即可:倒叙串逆序判断是否相等 镜像串列出两个字符串判断是否相等 注意:1.注意输出格式,每一个输出后有一个空格 2.判断镜像串满足条件有两个:一是是否在该字符串中,二是是否相 阅读全文
posted @ 2020-04-07 17:59 Joelin12 阅读(211) 评论(0) 推荐(0)
摘要: common typing error is to place thehands on the keyboard one row to theright of the correct position. So `Q' istyped as `W' and `J' is typed as `K' an 阅读全文
posted @ 2020-04-07 17:08 Joelin12 阅读(185) 评论(0) 推荐(0)
摘要: 题目:TEX is a typesetting language developed by Donald Knuth. It takes source text together with a fewtypesetting instructions and produces, one hopes, 阅读全文
posted @ 2020-04-07 16:39 Joelin12 阅读(177) 评论(0) 推荐(0)
摘要: 问题描述 对于长度为5位的一个01串,每一位都可能是0或1,一共有32种可能。它们的前几个是: 00000 00001 00010 00011 00100 请按从小到大的顺序输出这32种01串。 分析:1.观察得出第i-1行即为i-1所对应的二进制数,所以就转化成了十进制数转化为二进制数 2.初始化 阅读全文
posted @ 2020-03-02 09:17 Joelin12 阅读(194) 评论(0) 推荐(0)