首页 > TAG信息列表 > casenum

POJ 1852 Ants

题目传送门 点击这里 解题思路概要: 两个蚂蚁相撞之后,其实跟没有撞的效果是一样的。相当于还是每个蚂蚁在单独运动。 所以准备了两个数组,第一个数组存放题目中录入的数据。 第二个数组的大小是第一个数组的二倍。其中存入的数据除了第一个数组中的数据外,还要有木棍的长度减去

大数加法(A + B Problem Plus)问题

解题思路 两个⼤数可以⽤数组来逐位保存,然后在数组中逐位进⾏相加,再判断该位相加后是否需要进位。为了⽅便计算,可以把数字的低位放到数组的前面,高位放在后面。 样例输入 3 18 22 56 744 53234673473 7544645548767 样例输出 Case 1: 18 + 22 = 40 Case 2: 56 + 744 = 800 Case 3

duoji_diaodu

#include<cstdio> #include<algorithm> #include<string.h> using namespace std; int casenum; int tab[1003]; int machine[1002]; bool compare(int a,int b){ if(a>b) return true; else return false; } int main (){ scanf("%d&q