摘要: 这道题不怎么难,在每计算一次路程后,需要将这次输入的时间保存起来,下一次计算的时候,输入的时间需要减去上次保存的时间。 1 #include<stdio.h> 2 3 int main(void) 4 { 5 int i;//用于循环 6 int n; 7 int s,t,sum;//速度,时间,总 阅读全文
posted @ 2018-07-30 22:31 小小的嘤嘤怪 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 不知道为什么在POJ上就是通不过编译。。。 因为数据范围并不大,所以可以离线计算出所有的丑数。 说实话这个算法是网上找的,但是没有怎么看懂。 1 #include<stdio.h> 2 #include<string.h> 3 4 5 int a[1510];//丑数数组 6 7 int min(i 阅读全文
posted @ 2018-07-30 11:40 小小的嘤嘤怪 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Write a program to read four lines of upper case (i.e., all CAPITAL LETTERS) text input (no more than 72 characters per line) from the input file and 阅读全文
posted @ 2018-07-30 11:07 小小的嘤嘤怪 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 使用的是高中数学的一个公式,p=(a+b+c)/2,s=sqrt(p*(p-a)*(p-b)*(p-c)),由正弦定理a/sinA=b/sinB=c/sinC=2r,s=0.5*a*b*sinC,所以r=a*b*c/(4*s),然后就可以求周长了。 1 #include <stdio.h> 2 #i 阅读全文
posted @ 2018-07-30 10:50 小小的嘤嘤怪 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Problem A: Good evening, contestants. If a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, 阅读全文
posted @ 2018-07-30 10:45 小小的嘤嘤怪 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
TOP