关于读取
shift(233,422,5333,744433)要取出其中的数据据 所采用的方法
#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)
完全是抄博哥的代码思路, 这样就可以轻松解决 省赛的RMQ问题
下附链接地址


被折叠的 条评论
为什么被折叠?



