题目:推断卡号是否合法,给你4组4位的数字。偶数位的2倍的位和加上奇数位的和,推断尾数是否为0。

分析:简单题,模拟。

直接依照提议推断就可以。

说明:460题,加油!

#include <iostream>
#include <cstdlib> using namespace std; char data[4][5]; int main()
{
int n;
while (cin >> n)
for (int i = 1 ; i <= n ; ++ i) {
for (int i = 0 ; i < 4 ; ++ i)
cin >> data[i]; int d = 0,u = 0,t = 0;
for (int i = 0 ; i < 4 ; ++ i) {
t = (data[i][0]-'0')*2;
d += (t/10+t%10);
u += (data[i][1]-'0');
t = (data[i][2]-'0')*2;
d += (t/10+t%10);
u += (data[i][3]-'0');
} if ((d+u)%10)
cout << "Invalid" << endl;
else cout << "Valid" << endl;
}
return 0;
}

UVa 11743 - Credit Check的更多相关文章

  1. 在SAP C4C里触发SAP ERP的ATP check和Credit check

    在C4C里创建一个新的Sales Quote: 添加三个行项目: 执行action "Request External Pricing"会从ERP更新pricing信息,触发ATP ...

  2. UVA - 10196:Check The Check

    类型:简单模拟 大致题意:已知国际象棋行棋规则,给你一个局面,问是否将军?谁将谁的军?(保证不会同时将军) 思路:都以小写字母 测试 是否将 大写字母. 然后一个局面测两次(一次直接测,一次反转棋盘, ...

  3. UVA Open Credit System Uva 11078

    题目大意:给长度N的A1.....An 求(Ai-Aj)MAX 枚举n^2 其实动态维护最大值就好了 #include<iostream> #include<cstdio> u ...

  4. Zerojudge解题经验交流

    题号:a001: 哈囉 背景知识:输出语句,while not eof 题号:a002: 簡易加法 背景知识:输出语句,while not eof,加法运算 题号:a003: 兩光法師占卜術 背景知识 ...

  5. Credit Summaries & Importing External Credit Exposure

    In this Document   Goal   Solution APPLIES TO: Oracle Order Management - Version 11.5.10.2 to 12.1.3 ...

  6. pay-as-you-go

    What is pay as you go? A pay as you go deal means you aren’t tied into a contract and can top up you ...

  7. 客户信贷管理&临时授信

    信贷额度的组成:假如某客户信用限额1万:开出销售订单时锁定1万:一旦发货1万,销售订单1万限额释放,变成发货锁定限额1万.一旦开票,发货1万限额释放,应收锁定1万限额.清帐成功,应收释放1万.信用限额 ...

  8. web2.0最全的国外API应用集合

    web2.0最全的国外API应用集合 原文地址:http://www.buguat.com/post/98.html 2.0时代,越来越多的API被大家广泛应用,如果你还不了解API是何物,请看这里的 ...

  9. BPMN 2.0规范

    .1. BPMN 2.0是什么呢? 业务流程模型注解(Business Process Modeling Notation - BPMN)是 业务流程模型的一种标准图形注解.这个标准 是由对象管理组( ...

随机推荐

  1. vscode 调试vue.js程序

    npm install -g vue-cli                //安装vue-clivue init webpack projectName  //创建项目 1.Ctrl+~ 打开命令行 ...

  2. HDU-1035 Robot Motion 模拟问题(水题)

    题目链接:https://cn.vjudge.net/problem/HDU-1035 水题 代码 #include <cstdio> #include <map> int h ...

  3. Configure Tomcat 7 to run Python CGI scripts in windows(Win7系统配置tomcat服务器,使用python进行cgi编程)

    Pre-installation requirements1. Java2. Python steps1. Download latest version of Tomcat (Tomcat 7) f ...

  4. hbase启动报错

    前一段时间vmware上的ubuntu的hbase用不了了,而hadoop能正常的操作,非常的奇怪. 错误信息好像是connect fail, RPC什么的,看来跟网路有关. 想起以前曾经解决过hba ...

  5. Light OJ 1341 Aladdin and the Flying Carpet

    题意:求大于b的a的因数对有几组.例10  2结果为{2,5},12 2结果为{2,6}{3,4}-----不反复 解一:分解质因数+DFS #include <iostream> #in ...

  6. ztree中依据后台中传过来的node的id,将这个node的复选框置为不可用

    var treeObj = $.fn.zTree.getZTreeObj("treeDemo");//树对象 var node = treeObj.getNodeByParam(& ...

  7. 罗列几个Android插件化开发框架

    携程插件化框架 ACDD插件化框架 360插件化框架 Android-Plugin-Framework DL APK动态加载框架 部分框架对比 DynamicLoadApk 迁移成本很重:需要使用『t ...

  8. Alternating Sum

    http://codeforces.com/problemset/problem/963/A 不考虑正负的话,每两项之间之间公比为b/a,考虑正负,则把k段作为循环节,循环节育循环节之间公比为(b/a ...

  9. [React] Write Compound Components

    Compound component gives more rendering control to the user. The functionality of the component stay ...

  10. 关于app.FragmentManager和v4包的FragmentPagerAdapter冲突

    这几天发现一个问题我用getFragmentManager()得到FragmentManager不能放到FragmentPagerAdapter里面去.由于FragmentPagerAdapter里面 ...