Problem Description For products that are wrapped in small packings it is necessary that the sheet of paper containing the directions for use is folded until its size becomes small enough. We assume that a sheet of paper is rectangular and only folde…
ACM小白...非常费劲儿的学习中,我觉得目前我能做出来的都可以划分在水题的范围中...不断做,不断总结,随时更新 POJ: 1004 Financial Management 求平均值 杭电OJ: 1001 Sum Problem 相加1002 A + B Problem II 模拟人工加法-精度计算 1008 Elevator 很水,但是情况要考虑全面…
//第一题是猜数字的游戏.//题目:随即产生一个3位的正整数,让你进行猜数字,//如果猜小了,输出:"猜小了,请继续".//如果猜大了,输出:"猜大了,请继续".//如果猜对了.输出:"恭喜你,猜对了".//不过最多只能猜10次,如果猜了10次还没有猜对,就退出程序,输出:"Bye Bye". /*总结:此题最主要的地方就是产生随机数的方法:rand() % N + A, A为起始位,N为数字的总数.例如:随机生成0~10的数…
Carries frog has n integers a1,a2,-,an, and she wants to add them pairwise. Unfortunately, frog is somehow afraid of carries (进位). She defines hardness h(x,y) for adding x and y the number of carries involved in the calculation. For example, h(1,9)=1…
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=n; String result=null; while (n-->0){ String x=sc.next(); String y=sc.nex…
最近忙于考试复习,没有多少可供自己安排的时间,所以我利用复习之余的空闲时间去刷刷杭电acm的题目,也当对自己编程能力的锻炼吧. Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line of the input contains an integer T(1…
在网上看到这个题,觉得很有意思,也算是一种方法...但是复杂度同样很高,生成全排列本身需要很大复杂度. 题目:现在有 a 到 z 26 个元素, 编写程序打印 a 到 z 中任取 3 个元素的组合(比如 打印 a b c ,d y z等) 分析: 大家看看我这么做行不 char a, b, c; for(a = 'a'; a<='z'; a++) ; b<='z'; b++) ; c<='z'; c++) printf("%c%c%c\n", a, b, c); 问题…