201312-2 ISBN号码 100分 15ms

点击前往试题目录:https://blog.csdn.net/best335/article/details/99550556
在这里插入图片描述

#include<iostream>
#include<cstring>
using namespace std;
int main(){
	string s;
	cin>>s;
	int check=0,n=s.size(),ni=n-1;
	for(int i=0,j=1;i<ni;++i){
		if(s[i]=='-')continue;
		check+=(s[i]-'0')*j;
		++j;
	}
	if(s[ni]=='X'||s[ni]=='x') s[ni]='0'+10;
	if(check%11!=(s[ni]-'0')){
		if(check%11==10)
			cout<<s.substr(0,ni)<<"X"<<endl;
		else
			cout<<s.substr(0,ni)<<check%11<<endl;
	}
	else{
		cout<<"Right"<<endl;
	}
	return 0;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Advanced MS-DOS Programming The Microsoft(R) Guide for Assembly Language and C Programmers By Ray Duncan 带目录标签 PUBLISHED BY Microsoft Press A Division of Microsoft Corporation 16011 NE 36th Way, Box 97017, Redmond, Washington 98073-9717 Copyright (C) 1986, 1988 by Ray Duncan Published 1986. Second edition 1988. All rights reserved. No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher. Library of Congress Cataloging in Publication Data Duncan, Ray, 1952Advanced MS-DOS programming. Rev. ed. of: Advanced MS-DOS. (C)1986. Includes index. 1. MS-DOS (Computer operating system) 2. Assembler language (Computer program language) 3. C (Computer program language) I. Duncan, Ray, 1952-Advanced MS-DOS. II. Title. QA76.76.063D858 1988 005.4'46 88-1251 ISBN 1-55615-157-8 Printed and bound in the United States of America. 1 2 3 4 5 6 7 8 9 FGFG 3 2 1 0 9 8 Distributed to the book trade in the United States by Harper & Row. Distributed to the book trade in Canada by General Publishing Company, Ltd. Penguin Books Ltd., Harmondworth, Middlesex, England Penguin Books Australia Ltd., Ringwood, Victoria, Australia Penguin Books N.Z. Ltd., 182-190 Wairu Road, Auckland 10, New Zealand British Cataloging in Publication Data available IBM(R), PC/AT(R), and PS/2(R) are registered trademarks of International Business Machines Corporation. CodeView(R), Microsoft(R), MS-DOS(R), and XENIX(R) are registered trademarks and InPort TM is a trademark of Microsoft Corporation. Technical Editor: Mike Halvorson Production Editor: Mary Ann Jones Dedication For Carolyn

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值