JustOj 1936: 小明A+B
题目描述
小明今年3岁了, 现在他已经能够认识100以内的非负整数, 并且能够进行100以内的非负整数的加法计算. 对于大于等于100的整数, 小明仅保留该数的最后两位进行计算, 如果计算结果大于等于100, 那么小明也仅保留计算结果的最后两位. 例如, 对于小明来说: 1) 1234和34是相等的 2) 35+80=15 给定非负整数A和B, 你的任务是代表小明计算出A+B的值.
输入
输入数据的第一行为一个正整数T, 表示测试数据的组数. 然后是T组测试数据. 每组测试数据包含两个非负整数A和B(A和B均在int型可表示的范围内).
输出
对于每组测试数据, 输出小明A+B的结果.
样例输入
2
35 80
15 1152
样例输出
15
67 题解:终于找到一道能提交的题了 运算结果对100取模
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
return b?gcd(b,a%b):a;
}
const int N=;
const int mod=1e9+;
int main()
{
std::ios::sync_with_stdio(false);
int n;
cin>>n;
while(n--){
int a,b,s=;
cin>>a>>b;
if(a>=) a%=;
if(b>=) b%=;
s+=a;
s%=;
s+=b;
s%=;
cout<<s<<endl;
}
return ;
}
JustOj 1936: 小明A+B的更多相关文章
- 小明的密码-初级DP解法
#include #include #include using namespace std; int visited[5][20][9009];// 访问情况 int dp[5][20][9009] ...
- 小明系列问题――小明序列(LIS)
小明系列问题――小明序列 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u Submit ...
- ACM 擅长排列的小明
擅长排列的小明 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 小明十分聪明,而且十分擅长排列计算.比如给小明一个数字5,他能立刻给出1-5按字典序的全排列,如果你想 ...
- ACM 懒省事的小明
懒省事的小明 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 小明很想吃果子,正好果园果子熟了.在果园里,小明已经将所有的果子打了下来,而且按果子的不同种 ...
- 管闲事的小明-nyoj51
描述某校大门外长度为L的马路上有一排树,每两棵相邻的树之间的间隔都是1米.我们可以把马路看成一个数轴,马路的一端在数轴0的位置,另一端在L的位置:数轴上的每个整数点,即0,1,2,……,L,都种有一棵 ...
- HDU2096 小明A+B
入门级都没到的水题!看到顺便就做了,AC记录喜+1 Description 小明今年3岁了, 现在他已经能够认识100以内的非负整数, 并且能够进行100以内的非负整数的加法计算. 对于大于等于100 ...
- 小明A+B[HDU2096]
小明A+B Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submi ...
- nyist 676 小明的求助
http://acm.nyist.net/JudgeOnline/problem.php?pid=676 小明的求助 时间限制:2000 ms | 内存限制:65535 KB 难度:2 描述 ...
- nyist 604 小明的难题
http://acm.nyist.net/JudgeOnline/problem.php?pid=604 小明的难题 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 ...
随机推荐
- metasploit的安装
//直接安装 apt-get update apt-get install metasploit-framework //连接和安装postgresql apt-get install postgre ...
- sap 查看类的修饰属性
- IOP知识点(2)
1 URL资源访问不足时,需要添加URL权限 2 重定向问题解决办法:3 cloud-service-factory 项目 gradlew方法 1 URL资源访问不足时,需要添加URL权 ...
- [LeetCode] 581. Shortest Unsorted Continuous Subarray_Easy tag: Sort, Stack
Given an integer array, you need to find one continuous subarray that if you only sort this subarray ...
- MySQL数据类型--与MySQL零距离接触 3-2 外键约束的要求解析
列级约束:只针对某一个字段 表级约束:约束针对2个或2个以上的字段 约束类型是按功能来划分. 外键约束:保持数据一致性,完整性.实现数据表的一对一或一对多的关系.这就是把MySQL称为关系型数据库的根 ...
- iOS UI布局-VFL语言
什么是VFL语言 VFL(Visual Format Language),“可视化格式语言”. VFL是苹果公司为了简化autolayout的编码而推出的抽象语言. 语法说明 H:[cancelBut ...
- Thinkphp 3.2 验证码图片显示错误解决方法
在调用验证码之前加上 ob_clean(); 不显示验证码的代码: public function verify(){ $verify = new \Think\Verify(); $verify-& ...
- node.js初识05
小项目,需求,通过url来查询学生学号和老师的编号 05.js var http = require("http"); var server = http.createServer ...
- Jenkins. 安装过程中出现一个错误: No such plugin: cloudbees-folder
安装过程中出现一个错误: No such plugin: cloudbees-folder 安装插件,有时候会报类似的错误:An error occurred during installation: ...
- LeetCode111.二叉树的最小深度
给定一个二叉树,找出其最小深度. 最小深度是从根节点到最近叶子节点的最短路径上的节点数量. 说明: 叶子节点是指没有子节点的节点. 示例: 给定二叉树 [3,9,20,null,null,15,7], ...