NYOJ 786 Single Round Match
来源:互联网 发布:手机联系人备份软件 编辑:程序博客网 时间:2024/06/03 20:07
高精度求余
或者
将一个数奇位上的数字与偶位上的数字分别加起来,再求它们的差,如果这个差是11的倍数(包括0),那么,原来这个数就一定能被11整除.
#include<iostream>#include<string>using namespace std;int main(){ int n; string a,b; cin>>n; while (n--) { int sum1=0,sum2=0; cin>>a>>b; if (a!=b) cout<<"NO"<<endl; else { for (string::size_type i=0;i!=a.size();i++) { if (i%2) sum1+=a[i]-'0'; else sum2+=a[i]-'0'; } if ((sum1-sum2)%11==0) cout<<"YES"<<endl; else cout<<"NO"<<endl; } } return 0;}
0 0
- NYOJ 786 Single Round Match
- 1790. Single Round Match
- 1790. Single Round Match
- Single Round Match
- Single Round Match
- Single Round Match
- Single Round Match
- Single Round Match
- Single Round Match
- Single Round Match
- Single Round Match 695
- Sicily 1790. Single Round Match
- Sicily 1790. Single Round Match
- Sicily 1790. Single Round Match
- Problem J Single Round Match
- Sicily 1790. Single Round Match
- Single Round Match 585 Div2 A B
- GDCPC 2008:J Single Round Match
- [菜鸟每天来段CUDA_C]多GPU的使用
- JBPM5.4连接Mysql数据库
- 泛型函数和通配符的选择
- 字符串处理函数
- 数据类型、表达式 类型转换
- NYOJ 786 Single Round Match
- Android游戏开发 study 6-7
- 在R语言中,使用“=”和“<-”到底有什么不同? 就是等号和箭头号有什么区别,是完全一样还是局部不同?
- python解析json字符串和json文件的区别
- <activity-alias>详解
- 小布老师-PL_SQL(第二讲)
- 一步步学习SPD2010--第十二章节--理解可用性和可接入性(5)--测试可用性
- 深入分析 Java 中的中文编码问题——乱码是如何产生的
- MATLAB中均值、方差、均方差的计算方法