题目描述:
给定一个数字N,打印从1到最大的N位数。
输入:
每个输入文件仅包含一组测试样例。
对于每个测试案例,输入一个数字N(1
输出:
对应每个测试案例,依次打印从1到最大的N位数。
样例输入:
1
样例输出:
1
2
3
4
5
6
7
8
9
分析:
这是一个大数问题,利用字符串模拟运算。
#include
#include
#inc...
分类:
其他好文 时间:
2015-03-04 19:08:12
阅读次数:
149
Problem Description
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resultin...
分类:
其他好文 时间:
2015-02-22 11:07:30
阅读次数:
116
字符串模拟水题。 1 /* 3587 */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 #define MAXN 1005 ...
分类:
其他好文 时间:
2015-01-22 14:41:07
阅读次数:
174
字符串模拟水题。 1 /* 3587 */ 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 #define MAXN 1005 ...
分类:
其他好文 时间:
2015-01-22 12:49:37
阅读次数:
176
题目意思:
http://acm.hdu.edu.cn/showproblem.php?pid=2054
给出两个数,判断是否相等,相等输出YES,否则输出NO。
题目分析:
注意题目给的是两个数,没有说明格式和大小,只能字符串模拟比较,或者java大数比较。这里给出java的大数比较。
AC代码:
import java.math.BigDecimal;
impo...
分类:
编程语言 时间:
2015-01-13 19:57:52
阅读次数:
177
Andy's First Dictionary
Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu
Submit Status
Description
Problem B: Andy's First Dictionary
Time li...
分类:
编程语言 时间:
2014-12-27 14:00:20
阅读次数:
259
题目1362:左旋转字符串(Move!Move!!Move!!!)
时间限制:2 秒内存限制:32 兆特殊判题:否提交:1577解决:669
题目描述:
汇编语言中有一种移位指令叫做循环左移(ROL),现在有个简单的任务,就是用字符串模拟这个指令的运算结果。对于一个给定的字符序列S,请你把其循环左移K位后的序列输出。例如,字符序列S=”abcXYZdef”,要求输出循环左移3位后的结果,即“XYZ...
分类:
其他好文 时间:
2014-12-11 22:31:12
阅读次数:
246
CSU 1330: 字符识别?(字符串模拟啊 湖南省第九届大学生计算机程序设计竞赛)...
分类:
其他好文 时间:
2014-11-22 20:17:37
阅读次数:
153
题目信息: 手动模拟求大实数相加和
AC代码:
/**
*大实数相加,以小数点为分界,模拟加法运算,最后合并
*/
#include
#include
#include
using namespace std;
string add(string s1,string s2){//字符串模拟大整数加法,模拟结果有前导0...
分类:
其他好文 时间:
2014-10-21 21:32:54
阅读次数:
190