Blue Bridge Cup cipher generator

Source: Internet
Author: User

The program task is to convert the genetic phonetic alphabet to 6 digits, we can use any well-remembered pinyin string, the transformation process is as follows, the first step, the string six a group of folding up, such as wangximing into:

Wangxi

Ming

In the second step, we want to add the ASCII value of all the characters perpendicular to the same position, and draw out 6 numbers, as the example above, then draw 228 202 206

Then the number of each digit processing, that is, the number of each bit is added, the figure if not a number, in the indentation, and finally into 344836

#include <stdio.h>#include<string.h>intCheckintN) {    intsum=0; if(n<Ten)returnN//returns directly when N is a single digit     while(n>0){//plus the numbers on each bit of N.sum+=n%Ten; N=n/Ten; } check (sum); //check and whether it is single digit, repeat the above operation}//Wangxi//MingvoidFChara[]) {    intb[6]={0};//creates a new array that is stored in a character array and     for(intI=0; I<strlen (a); i++) {B[i%6]+=a[i];//new array loop to add new characters    }     for(intI=0;i<6; i++) {printf ("%d", B[i]); } printf ("\ n");  for(intI=0;i<6; i++) {printf ("%d", check (B[i])); }}intMain () {Chara[]={"wangximing"};    f (a); return 0;}

Blue Bridge Cup cipher generator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.