TIPS: the idea of handling the operations of reading numeric values from strings ~ Ze's descendants

Source: Internet
Author: User

Question Link

About reading

shift(233,422,5333,744433) 

Method used to retrieve data

#include<stdio.h>#include<iostream>using namespace std;int main(){   char a[30],*p;   int rec[30];   while(gets(a)){       p=a;       p+=6;       int bit,n=0;       while(strlen(p)){            sscanf(p,"%d%n",&rec[n++],&bit);            p+=bit+1;             cout<<rec[n-1]<<endl;            cout<<"bit="<<bit<<endl;                      }       cout<<"n="<<n<<endl;       for(int i=0;i<n;i++)          cout<<rec[i]<<" ";       cout<<endl;          }            }//shift(2,4,5,7) 

It is completely a copy of bogo's code ideas, so that you can easily solve the RMQ problem of the provincial Competition

Link below

RMQ question link

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.