#include <iostream>
#include <cassert>
using namespace std;
int atoii(char *str)
{
assert(str != NULL);
int num = 0;
while(*str != NULL)
{
if(*str>='0' && *str<='9')
{
num *= 10;
num += *str-'0';
}
str++;
}
return num;
}
int main()
{
char *str = new char[10];
cin.getline(str,10);
cout<<atoii(str);
cout<<endl;
return 0;
}
,如:1234 --1234&spm=1001.2101.3001.5002&articleId=5813573&d=1&t=3&u=c6ffdf20dd6b402c80926497a658e336)
8301

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



