IBSN

package practiceofcsp;

import java.util.Scanner;

public class StrPractice {
	public static void main(String[] args) {
//		System.out.println(Integer.parseInt("323"));//把字符串变成整数
//		System.out.println("s23".charAt(0));//这个函数返回的是char
//		System.out.println(String.valueOf('2'));//这个函数可以把char变成String
//		char a="232".charAt(0);
//		System.out.println(Integer.parseInt(String.valueOf((a))));//char可以和int 相互转换
		Scanner sc=new Scanner(System.in);
		String s=sc.nextLine();
		int result=0;
		int c=0;
		for(int i=0;i<s.length()-1;i++) {
			if(s.charAt(i)=='-') {
				continue;
			}
			else {
				c+=1;
				result+=c*Integer.parseInt(String.valueOf(s.charAt(i)));
			}
		}
		result=result%11;
		char compare=s.charAt(s.length()-1);
//		System.out.println("(char)compare"+compare);
//		System.out.println("(int)compare"+(int)compare);
		if(compare=='X'&&result==10||(int)compare==result+48) {
				System.out.println("Right");
		}
		else {
//			for(int i=0;i<s.length()-1;i++) {
//				System.out.print(s.charAt(i));
//			}
			//上述for循环可用s.substring(0,length-1)直接输出0-length-2位
			System.out.print(s.substring(0, s.length()-1));
			if(result==10) {
				System.out.println('X');
			}
			else {
				System.out.println(result);
			}
		}


		


		
	}
}

 

1. Book(Title,ISBN,Edition,Date of Publication,Price,Book Description,Publisher id); PK(ISBN) FK(Publisher id)->Publisher(Publisher id) 2. Author(Author Name,Author_id); PK(Author_id) 3. Publisher(Publisher id,Publisher Name,Address); PK(Publisher id) AK(publisher name,address) 4. Customer(Customer_id,first name,middle name,last name,Mailing Address,Credit Card Number and Expiration Date,Phone Number,Email Address); PK(Customer_id) AK(Credit Card Number and Expiration Date) 5. Shipment(Date of Shipment,Tracking Number,Date of Expected Delivery); PK(Tracking Number) 6. Order(Order Number,Mailing Address,Method of Shipment,Date and Time of Order); PK(Order Number,Customer_id) FK(Customer_id)->Customer(Customer_id) 7. Promotion(Promotion id number,Percentage Discount Points,start date,end date); PK(Promotion id number) 8. Line Item(Total price for each book that is ordered ,Quantity of each item ordered ,Book IBSN,Order Number); FK(Book IBSN)->Book(IBSN);(Order Number)->Order(Order Number);(Tracking Number)->Shipment(Tracking Number) 9. Category(Category ID,Category Name); PK(Category ID) FK(Category ID)->Isa_Category(SubcategoryID) 10. Total Price of the Order(Price,Order Number); FK(Order Number)->Order(Order Number) PK(Price,Order Number) 11. Isa_Category(SubcategoryID,SuperCategoryID); PK(SuperCategoryID) 12. Write(Author_id,ISBN); PK(Author_id,ISBN) FK(Author_id)->Author(Author_ID);(ISBN)->Book(ISBN) 13. BelongTo(ISBN,Category ID); PK(ISBN,Category ID) FK(ISBN)->Book(ISBN);(Category ID)->Category(Category ID) 14. Promote(ISBN,Promotion id number); PK(ISBN,Promotion id number) FK(ISBN)->Book(ISBN);(Promotion id number)->Promotion(Promotion id number)。使用CREATE TABLE语句对关系架构进行编码,应指定完整性约束,键关系等
06-11
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值