我的代码游记

标签 · 杭电HDU

首页

关于

归档

杭电HDU搜索

1262.寻找素数对

Problem Problem Description哥德巴赫猜想大家都知道一点吧.我们现在不是想证明这个结论,而是想在程序语言内部能够表示的数集中,任意取出一个偶数,来寻找两个素数,使得其和等于该偶数.做好了这件实事,就能说明这个猜想是成立的.由于可以有不同的素数对来表示同一个偶数,所以专门要求所寻找的素数对是两个值最相近的.Input输入中是一些偶整数M(5<M<=10000).Output对于每个偶数,输出两个彼此最接近的素数,其和等于该偶数.Sample Input20 30 40Sample Output7 1313 1717 23 Solution#include<stdio.h> #include<math.h> int sushu(int x) &#..

更多
杭电HDU

1094.A+B for Input-Output Practice (VI)

Problem Problem DescriptionYour task is to calculate the sum of some integers.InputInput contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line.OutputFor each test case you should output the sum of N integers in one line, and with one line of output for each line in input.Sample ..

更多
杭电HDU

1096.A+B for Input-Output Practice (VIII)

Problem Problem DescriptionYour task is to Calculate the sum of some integers.InputInput contains multiple test cases. Each test case contains a integer N, and then N integers follow in the same line. A test case starting with 0 terminates the input and this test case is not to be processed.OutputFor each group of input integers you should output their sum..

更多
杭电HDU

1720.A+B Coming

Problem Problem DescriptionMany classmates said to me that A+B is must needs.If you can’t AC this problem, you would invite me for night meal. ^_^InputInput may contain multiple test cases. Each case contains A and B in one line.A, B are hexadecimal number.Input terminates by EOF.OutputOutput A+B in decimal number in one line.Sample Input1 9A Ba bSample Ou..

更多
1238