zoj 2001 Adding Reversed Numbers】的更多相关文章

Adding Reversed Numbers Time Limit: 2 Seconds      Memory Limit: 65536 KB The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2001 Adding Reversed Numbers Time Limit: 2 Seconds      Memory Limit: 65536 KB The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient pla…
The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore the dramatic advisor of ACM has decided to transfigure some tragedies into comedies. Obviously, this work is very har…
Adding Reversed Numbers Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 17993 Accepted: 9733 Description The Antique Comedians of Malidinesia prefer comedies to tragedies. Unfortunately, most of the ancient plays are tragedies. Therefore t…
------------------------------------------------------------ 以此题警告自己: 总结, 1.在数组的使用时,一定别忘了初始化 2.在两种情况复制代码时,一定要小心,注意修改变量名,一不留神就会带来不可估量的后果,一定要仔细挨着一个一个变量的修改,别跳着看着哪个变量就改哪一个变量! (这个题目中,就是复制了一下,代码,ca,我找了一下午的错....还好终于找到了,一个字母的错,) -----------------------------…
题意:给两个整数,求这两个数的反向数的和的反向数,和的末尾若为0,反向后则舍去即可.即若1200,反向数为21.题目给出的数据的末尾不会出现0,但是他们的和的末尾可能会出现0. #include <iostream> #include <string.h> #include <stdio.h> #include <string> #include <string.h> using namespace std; int n1,n2;//n1表示a的…
/*Sample Input 3 24 1 4358 754 305 Sample Output 34 1998 */ 值得总结的几点就是: 1.atoi函数将字符串转化为整型数字(类似于强制转换) 2.sprintf函数的用法,比如sprintf(res,"%d",i+j); 3.这种将字符串逆置的方法应该是最简洁的 #include<iostream> #include <stdio.h> #include <stdlib.h> #include…
一.题目大意 反转两个数字并相加,所得结果崽反转.反转规则:如果数字后面有0则反转后前面不留0. 二.题解 反转操作利用new StringBuffer(s).reverse().toString();来实现,去0则利用while循环对10取余判断,对数取整.多次用到字符串和整数之间的互换,字符串转整数用到了 int num=Integer.parseInt(s);,整数转字符串则s= ""+a1;即可. 三.java代码 import java.util.Scanner; publi…
原题链接 题目大意:给一个16位的数字,表示一个浮点数,按照规则转换成科学计数法表示. 解法:注释比较清楚了,注意浮点运算的四舍五入问题. 参考代码: #include<iostream> #include<cmath> #include<cstdio> #include<iomanip> #include<string.h> using namespace std; int main(){ char in[16],out[16]; int i,…
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1405 要求找出4位数所有10进制.12进制.16进制他们各位数字之和相等. #include<cstdio> int getsum(int n,int k) { int sum=0; while(n) { sum+=n%k; n/=k; } return sum; } int main() { int n=1000; while(n<10000) { int sum1…