POJ 2190 模拟
来源:互联网 发布:淘宝商家的客服电话 编辑:程序博客网 时间:2024/06/05 13:42
按照题意模拟就好…
注意“X”只能出现在最后一位。。。
// by SiriusRen#include <cstdio>using namespace std;char s[15],mark;int main(){ scanf("%s",s+1); int temp=0; for(int i=10;i;i--){ if(s[11-i]=='X')s[11-i]='0'+10; else if(s[11-i]=='?'){mark=i;continue;} temp+=i*(s[11-i]-'0'); } for(int i=0;i<=10;i++) if((temp+i*mark)%11==0){ if(i!=10){printf("%d",i);return 0;} else if(mark==1){puts("X");return 0;} } puts("-1");}
0 0
- POJ 2190 模拟
- POJ 2190(模拟策略)
- poj 2190 isbn 模拟
- poj 2190 简单模拟(ISBN)
- POJ 1017 模拟啊模拟
- POJ 1565 水 模拟
- Poj 模拟题
- POJ 1068 括号模拟
- POJ 2453 简单模拟
- POJ 2833 简单模拟
- POJ 1016 模拟题
- 模拟退火 poj 1379
- poj 1379 模拟退火
- poj 3285 模拟退火,
- POJ 1068 Parencodings 模拟
- POJ 3295 Tautology 模拟
- POJ 1099 模拟
- poj 3427 模拟
- CAFFE中 安装google protobuf
- iOS开发UI篇—Quartz2D使用(信纸条纹)
- 关于assetbundle
- 【广利核面试题】C语言中goto语句为什么要少用甚至不用?
- rman命令资料
- POJ 2190 模拟
- 05 Activity 回传数据
- Linux下命令行连接MySQL
- ASM(字节码处理工具)
- hive與hadoop交互過程
- 网页挂马
- 第四章:Java新特性对数组的支持
- ifstream、ofstream文件流操作
- SQL性能个人实践心得【持续更新】