题目的意思是从2992開始的四位数.每个四位数的10.12,16进制的数的每一位加起来都相等,就输出该数. 非常easy的一道题目. 以下的是AC的代码: #include <iostream> using namespace std; int main() { int i, j, k, n, m; for(i = 2992; i < 10000; i++) { n = 0; m = 0; k = 0; j = i; while(j) { n += j % 10; j /= 10; }…
Help Johnny(类似杭电3568题) Description Poor Johnny is so busy this term. His tutor threw lots of hard problems to him and demanded him to accomplish those problems in a month. What a wicked tutor! After cursing his tutor thousands of times, Johnny real…
Billboard Time Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 14144 Accepted Submission(s): 6058 Problem Description At the entrance to the university, there is a huge rectangular billboard of…
最近在尝试做acm试题,刚刚是1001题就把我困住了,这是题目: Problem Description In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series of integers n, one integer per line Output For each case, output SUM(n) in one…