search
Homephp教程php手册In my late night brainstorming, I wrote a small program that can calculate the ID number for train tickets.

1. The * number on the train ticket is the month and day. Theoretically, there are a maximum of 366 combinations; 2. The check code is the last digit, 0-9 and X, 11 results; 3. Then , through the ID number on the train ticket, you can get about 33 real valid ID numbers; 4. If you can know the other person’s zodiac sign (well, don’t everyone often reveal what zodiac sign they are), then,

1. The * number on the train ticket indicates the month and day. In theory, there are a maximum of 366 combinations;

2. The check code is the last digit, 0-9 and X, 11 results;

3. Then, through the ID number on the train ticket, you can get about 33 real valid ID numbers;

4. If you can know the other person’s zodiac sign (well, don’t we often reveal what zodiac sign we are), then map these 30-plus results to 12 zodiac signs, and the final possibility is only 2-3 . . .

5. Conclusion: When posting tickets, be sure to code them

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Geyunfei.CheckID
{
    class PRogram
    {

        static int[] a = new int[] { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 };
        static char[] b = new char[] { '1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2' };
        static int index = 0;
        static void Main(string[] args)
        {

            System.Console.WriteLine("输入火车票上的身份证号:");

            String a = System.Console.ReadLine();
            var year = int.Parse(a.Substring(6, 4));
            var beginDate = new DateTime(year, 1, 1);
            var chk = a.Substring(14);

            int days = 365;
            if (DateTime.IsLeapYear(year))
                days++;
            for(int i =0;i<days; i++)
            {
                var chkDate = beginDate.AddDays(i).ToString("MMdd");
                var id = a.Substring(0, 10) + chkDate + chk;
                CheckID(id);

            }
           

        }

        private static void CheckID(string id)
        {
            int sum = 0;
            for(int i = 0; i < 17; i++)
            {
                sum += int.Parse(id[i].ToString()) * a[i];
            }
            var chk = b[sum % 11];
            if (chk == id[17])
            {
                index++;
                Console.WriteLine(getAstro(int.Parse(id.Substring(10,2)),int.Parse(id.Substring(12,2)))+ index.ToString() +" "+id);
            }
        }

        private static String getAstro(int month, int day)
        {
            String[] starArr = {"魔羯座","水瓶座", "双鱼座", "牡羊座",
        "金牛座", "双子座", "巨蟹座", "狮子座", "处女座", "天秤座", "天蝎座", "射手座" };
            int[] DayArr = { 22, 20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22 };  // 两个星座分割日
            int index = month;
            // 所查询日期在分割日之前,索引-1,否则不变
            if (day < DayArr[month - 1])
            {
                index = index - 1;
            }
            index = index % 12;
            // 返回索引指向的星座string
            return starArr[index];
        }

    }
}

 


Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
一个身份证可以开几个淘宝店一个身份证可以开几个淘宝店Oct 10, 2023 pm 01:51 PM

一个身份证只能开设一个淘宝店,卖家应该遵守淘宝平台的规定,不要尝试使用其他人的身份证来开设多个店铺。卖家可以通过店铺合并和开设分店的方式来拓展业务,提高销售额。但是需要注意的是,每个分店都需要使用独立的身份证进行实名认证。

可以删除downloads文件夹吗?可以删除downloads文件夹吗?Feb 19, 2024 pm 03:38 PM

downloads可以删除吗近年来,随着数字化时代的来临,我们生活中出现了越来越多的数字化产品和服务。而随之而来的,就是我们对于数字化内容的需求与日俱增。在日常生活和工作中,我们经常需要下载各种各样的文件,如文档、图片、音频和视频等等。而这些下载的文件,通常都被保存在一个名为“downloads”(下载)的文件夹之中。然而,随着时间的推移,我们经常会发现,“

12306火车票怎么查询12306火车票怎么查询Feb 23, 2024 pm 05:30 PM

12306火车票怎么查询?铁路12306APP中是可以购买火车票随时的查询,但是多数的小伙伴不知道12306火车票如何的查询,接下来就是小编为用户带来的12306火车票查询方法图文教程,感兴趣的用户快来一起看看吧!12306火车票怎么查询1、首先打开铁路12306APP,进入首页面选择你需要购买地点的车票;2、然后挑战到下图的位置,选择你需要车次付款之后可以查询火车票。

i34150搭配1G独显适合玩哪些游戏(i34150适用于哪些游戏)i34150搭配1G独显适合玩哪些游戏(i34150适用于哪些游戏)Jan 05, 2024 pm 08:24 PM

i34150搭配1G独显能玩哪些游戏能玩lol等小游戏。GTX750和GTX750TI是非常合适的显卡选择。如果只是玩一些小游戏或者不玩游戏,建议使用i34150的集成显卡就可以了。一般来说,显卡和处理器的搭配差价并不是很大,所以选择合理的搭配是很重要的。如果需要2G显存,推荐选择GTX750TI;如果只需要1G显存,直接选择GTX750即可。GTX750TI可以看作是GTX750的增强版本,具有超频功能。i34150可以搭配什么显卡根据需求,如果你打算玩单机游戏,建议你考虑更换显卡。你可以选择

如何利用C++实现一个简单的火车票订购系统?如何利用C++实现一个简单的火车票订购系统?Nov 03, 2023 pm 03:02 PM

随着人们工作和生活方式的变化,越来越多的人选择乘坐火车出行。因此,实现一个简单的火车票订购系统可以方便用户预订车票,同时也可以提高工作效率,减少人力投入。本文将介绍如何使用C++实现一个简单的火车票订购系统,以方便读者学习和实践。一、需求分析在开始编写火车票订购系统之前,我们需要明确系统的需求,来确定大致的开发思路。在本文中,我们将实现以下基本功能:1.用户

如何在 iPhone 15上永久阻止您的号码?如何在 iPhone 15上永久阻止您的号码?Sep 17, 2023 pm 03:41 PM

如何在iPhone上永久阻止您的号码?iPhone上有一个选项可以隐藏您从设备拨打的每个电话的手机号码。这可以通过永久更改设备上的设置来完成。为此,您需要在iPhone上打开“设置”应用程序,然后选择“电话”应用程序,然后需要向下滚动,直到看到“显示我的呼叫ID”,选择该选项,然后将开关切换为关闭。启用此设置后,您拨打的任何电话都不会将您的手机号码提供给您要呼叫的人。如果您使用iPhone拨打工作电话,就像许多人在全球大流行期间在家工作时所做的那样,这可能是一个有用的功能。您可以按照上述步骤轻松

pagefile.sys可以删除吗?pagefile.sys可以删除吗?Feb 21, 2024 pm 10:30 PM

pagefile.sys可以删除吗?pagefile.sys是Windows操作系统中的一个系统文件,它被用作虚拟内存(VirtualMemory)的一部分。虚拟内存是指操作系统将部分硬盘空间用作扩展内存的一种机制。它的作用是为了在物理内存(RAM)不足时,将一部分数据从RAM中转移到硬盘上,以释放出更多的RAM空间供其他程序使用。由于虚拟内存是操作系统重

如何在iPhone上阻止垃圾电话和短信如何在iPhone上阻止垃圾电话和短信Jul 22, 2023 pm 08:22 PM

Apple在iPhone中集成了各种功能,可用于有效阻止垃圾电话和不需要的短信。这些内置工具不仅使您能够保护您的设备免受此类滋扰,还可以报告这些垃圾邮件发送者。通过这样做,您可以为防止将来不仅在您的设备上而且在其他人的设备上出现垃圾电话和短信做出了贡献。如何在iPhone上阻止垃圾邮件发送者的单个电话号码如果您收到来自iPhone上特定电话号码的垃圾电话,则可以阻止该电话号码,以便您不会再收到来自它的任何电话,这在iPhone上很容易做到。要阻止来自iPhone上特定号码的垃圾电话,请在设备上打

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),