Garlic Guest Sogou Input Method (single output)

Source: Internet
Author: User

Sogou Input Method recently appeared in the user input a new input mode, shaped like "0k1234567", Sogou engineers found that this model is known, this is a new proposed for the digital notation of the mark mode, where "0k" is a tag into the 15 prefix tag, after the section " 1234567 "is the actual number string of the XV binary.
After discovering this pattern, Sogou's engineers began to try to further add to the existing Word segmentation algorithm for the processing of the digital string, the 15 binary number of this form of the Web page is correctly extracted. We know that the mark "0k" in the "K" must be lowercase, the number 0 to 14 in this set of marked mode will be expressed in sequence: 0k0, 0k1, ..., 0k9, 0kA, 0kB, 0kC, 0kD, 0kE. This means that only 0-9, K, and A-e will appear in the 15 binary numbers.
It is important to note that there is no extra 0 in the number representation, such as 0k05, which cannot be used as a binary number. In addition, as a convention, when the "0k90k8" occurs, only the 0k90 is in line with the expected number of digits, that is, always from left to right in order to extract the longest number of XV. If you wish to express the ligatures of the two numbers of 0k9 and 0K8, it will be written in the form of "0k9 ' 0k8" (single quotes represent any other non-numeric characters).
Sogou engineers want to be in the user input in accordance with the above requirements of all the XV number of output in turn. Can you do it for him?
Input format
Enter a line of String str (1≤|str|≤106) to indicate the user input from the Sogou engineer. The characters in the user input must be numbers (0-9) or uppercase letters (A-Z, A-Z).
Output format
The output consists of several lines, each of which outputs an extracted XV number (in the form of: 0k1234), corresponding to the number of decimal digits in the input string that conform to the tag pattern, and output, in the order in which the numbers are in the original string.
Example 1
Input:
Sjfjfhua0ka0000lmnhdhahdfhggdjg90k10k110k120kf
Output:
0ka0000
0k110
1#include <iostream>2#include <stdio.h>3#include <string.h>4 using namespacestd;5 Chara[1000001];6 intMain ()7 {8     intlen,i,j,k,flag=0;9 gets (a);Tenlen=strlen (a); One      for(i=0; i<len-2; i++) A       { -           if(a[i]=='0'&&a[i+1]=='k') -           { the               if(a[i+2]>='A'&&a[i+2]<='E'|| a[i+2]>='0'&&a[i+2]<='9') -printf"0k"); -             if(a[i+2]=='0') -             { +printf"0"); -                  +i=i+2; Aprintf"\ n"); at             } -             Else{ -flag=0; -                for(j=i+2; j<len;j++) -               { -                 if(a[j]>='A'&&a[j]<='E'|| a[j]>='0'&&a[j]<='9') in                     { -printf"%c", A[j]); toflag=1; +                     } -                     Else the                       Break; *                  $             }Panax NotoginsengI=J; -             if(flag) theprintf"\ n"); +             } A           } the       } +  -     return 0; $}

Garlic Guest Sogou Input Method (single output)

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.