UVa 11743 - Credit Check

题目:推断卡号是否合法,给你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;
}
 
时间: 2024-10-12 00:27:53

UVa 11743 - Credit Check的相关文章

Credit Summaries &amp; Importing External Credit Exposure

In this Document   Goal   Solution APPLIES TO: Oracle Order Management - Version 11.5.10.2 to 12.1.3 [Release 11.5.10 to 12.1] Information in this document applies to any platform. ***Checked for relevance on 09-Oct-2013*** GOAL Questions on 'Credit

SAP事务码 一

SE80 -- edit source code. SE24 -- class create or display. SFP -- created and maintained independently of Web Dynpro applications using the Form Builder. SFW1 SFW2 SFW3 -- 与增强有关 SY-SUBRC 返 回代码值( 0,如果操 作成功)   SY-UNAME 用 户的登录名   SY-DATUM 当 前日期   SY-UZE

EBS 信用检查(二)

Credit checking feature of Oracle OM provides the ability to check that the customer has sufficient credit available with the organization at the point of order booking ,picking, packing and shipping. Credit check rules, order transaction type, payme

PLSQL Coding Standard

Naming and Coding Standards for SQL and PL/SQL "The nice thing about standards is that you have so many to choose from." - Andrew S Tanenbaum Introduction This document is mentioned in a discussion on the OTN forums. One of the first comments be

SD从零开始51-54 信用控制范围, 信用范围数据维护, 自动信用控制, 信用控制-阻止后续功能

[原创] SD从零开始51 信用控制范围 分散的组织结构Decentralized Organization 信用控制范围是一个为客户指定和控制信用限额的组织单元: 依赖于你公司的需求,应收款可以使用集中的或者分散的信用政策来管理: 使用分散的信用政策,每个公司代码可以为它的客户确定它自己的信用数据: 一个销售组织只可以分配给一个公司代码,一个业务交易只可以分配给一个信用控制范围: 集中的组织结构Centralized Organization 在集中的组织结构中,公司代码组合到信用管理的一个信

Linux-pam_cracklib.so选项详解

pam_cracklib.so位于/etc/pam.d/system-auth中 pam_cracklib.so 相关的 options debugThis option makes the module write information to syslog(3) indicating the behavior of the module(this option does not write password information to the log file). authtok_type

EBS 信用检查

信用逻辑 This post will more focus on Technical part of credit check Functionality. You can check the functional part of credir check functionality here.  TABLES These are the main tables used for holding Credit Check functionality. OE_HOLD_AUTHORIZATION

Servlet 前端后台交互

一. URL地址传值   1.1. 地址传值 http://localhost:8080/xj/123/name.json servlet 对应接受方法 1 @RequestMapping(value="/{name}/list.json",method = RequestMethod.GET) 2 public @ResponseBody Object list(HttpServletRequest request, @PathVariable("name") S

客户信贷管理&amp;临时授信

信贷额度的组成:假如某客户信用限额1万:开出销售订单时锁定1万:一旦发货1万,销售订单1万限额释放,变成发货锁定限额1万.一旦开票,发货1万限额释放,应收锁定1万限额.清帐成功,应收释放1万.信用限额又回到1万了,如此循环. ? 未清订单价值:未清订单价值是所有未交货的订单条目的价值:未清订单的价值是基于已确认数量的(已确认数量乘以信用价格=订单的未清订单价值):因信用检查已经被锁住的订单不包含已确认的数量:只要锁还在,未清订单价值就不会增加 ? 未清交货价值:未清交货价值是所有尚未出具发票的交