摘要: Judging a programming contest is hard work, with demanding contestants, tedious decisions, and monotonous work. Not to mention the nutritional problem 阅读全文
posted @ 2018-07-30 10:20 小小的嘤嘤怪 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 这道题我使用一个长度为256的字符数组存储输入,然后令sum=0,从a[0]开始遍历,如果当前的a[i]是大写字母,则计算这个大写字母的ASCII码-64后乘i+1的值,将该值加到sum中,最后输出sum。 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 阅读全文
posted @ 2018-07-30 10:07 小小的嘤嘤怪 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Find and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when repr 阅读全文
posted @ 2018-07-29 22:58 小小的嘤嘤怪 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Adapted from Wikipedia, the free encyclopedia The humidex is a measurement used by Canadian meteorologists to reflect the combined effect of heat and 阅读全文
posted @ 2018-07-29 22:54 小小的嘤嘤怪 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 试图使用离线计算的方法但是失败了,wa到我一脸懵逼,因此对每一个数据,我从放一张卡开始计算长度,直到长度大于给出数为止。 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <math.h> 4 5 6 int main(void){ 7 do 阅读全文
posted @ 2018-07-29 22:14 小小的嘤嘤怪 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 使用题给数据计算出面积,然后向上取整,若向下取整会提前1年失去土地。 然后使用一个for循环得到失去土地的时间 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <math.h> 4 5 int main(void){ 6 int n,i,j 阅读全文
posted @ 2018-07-29 21:53 小小的嘤嘤怪 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 这道题中由于素数的范围只有10000(比较小),因此可以计算出10000以内的所有素数,存储到一个数组中,方便计算素数和的时候使用。 因为一个素数的倍数都不是素数,所以可以从2的倍数开始剔除,2的倍数剔除完后剔除3的倍数,......,以此类推。 计算完素数后需要计算一个正整有多少个连续素数的表示 阅读全文
posted @ 2018-07-29 18:05 小小的嘤嘤怪 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 首先使用一个数组来存储输入,当输入0时停止存储,然后使用一个二重循环来统计doubles的数目. 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main(void){ 5 int a[15],b,i=0,j,k,cnt=0; 6 while(s 阅读全文
posted @ 2018-07-29 15:51 小小的嘤嘤怪 阅读(92) 评论(0) 推荐(0) 编辑
TOP