Posts Tagged: poj
-
十 23, 2010
3 Commentsjava笔试第4题,1~60000有多少个1
长春工业大学 Java 小组的一个笔试题 java笔试第4题,1~60000有多少个1,查出1~60000有多少个1 答案应该是34000 请编写一个程序,数出 1~60000 一共有多少个 1? 例如:1.2.3.4.5.6.7.8.9 中有 1 个 110.11.12.13.14.15.16.17.18.19 共有 11 个 1 所以1~20一共12个1. 暂时有2个思路,一个是比较 容易想到的方法: 方法一: 那就 是从 1 开始遍历到 N,将其中每一个数中含有“1”的个数加起来, 自然就得到了从 1 到 N 所有“1”的个数的和。写成程序如下: public static int countOneByOne( int num){ int count = 0; for(int i = 0;i <= num; i++){ int tmp = i;...
-
八 13, 2010
No Comments【转】可爱的 Hello World !【zz】
不同年龄职业的人所写的Hello World程序 高中(BASIC) 10 PRINT "HELLO WORLD" 20 END 大一(PASCAL) program Hello(input, output) begin writeln('Hello World') end. 大二以后(LISP) (defun hello (print (cons 'Hello (list 'World)))) 职场新人(C) #include <stdio.h> void main(void) { char *message[] = {"Hello ", "World"}; int i; for(i = 0; i < 2; ++i) printf("%s", message[i]); printf("\n"); } ...
-
六 02, 2010
No Comments有道难题挑战赛-与7无关的数
查看 提交 统计 讨论 时间限制: 1000ms 内存限制: 65536kB 描述 一个正整数,如果它能被7整除,或者它的十进制表示法中某个位数上的数字为7,则称其为与7相关的数.现求所有小于等于n(n<100)的与7无关的正整数的平方和. 输入 输入为一行,正整数n,(n<100) 输出 输出小于等于n的与7无关的正整数的平方和 样例输入 21 样例输出 2336...
-
五 30, 2010
No CommentsJOJ 1008-Go hang a salami, I-AC
Result TIME Limit MEMORY Limit Run Times AC Times JUDGE 3s 8192K 7476 1359 Standard Given a character string, determine if it is a palindrome. A palindrome is a word or phrase that reads the same forwards and backwards, like mom or noon. For our purposes, palindromes are case insensitive, so Bob and Anna are...
-
五 30, 2010
No Commentsjoj 1007 accept
1007: Triangles Status In/Out TIME Limit MEMORY Limit Submit Times Solved Users JUDGE TYPE stdin/stdout 3s 8192K 4775 1749 Standard A triangle can be made up out of dots, like the ones shown below: The number of dots in each one is called a triangular number. More precisely, a number is said to be triangular...
-
五 28, 2010
No CommentsPOJ1042 Gone FIshing–AC附测试数据
Gone Fishing Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 15779 Accepted: 4403 Description John is going on a fishing trip. He has h hours available (1 < =...
-
五 28, 2010
No CommentsPOJ 上的问题分类
POJ...