-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path源.cpp
62 lines (50 loc) · 850 Bytes
/
源.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include <iostream>
#include <stdlib.h>
using namespace std;
unsigned _int64* Chartoint()
{
char example[]="123 4568 123456 332222";
int i=0,temp_int=0,j=0,k=0;
int length_int=0;
for(i=0;example[i]!='\0';i++)
{
if(example[i]==' ')
length_int++;
}
length_int++;
unsigned _int64 *result=new unsigned _int64[length_int];
for(i=0;i<strlen(example);i++)
{
j=i;
while(example[++i]!=' ')
{
if(example[i]=='\0')
break;
}
temp_int=0;
while(j<i)
{
temp_int=temp_int*10+(example[j]-'0');
j++;
}
result[k++]=temp_int;
}
j++;
temp_int=0;
while(j<i)
{
temp_int=temp_int*10+(example[j]-'0');
j++;
}
result[k++]=temp_int;
// for(i=0;i<length_int;i++) ²âÊÔ
// cout<<result[i]<<' ';
return result;
}
int main()
{
unsigned _int64 *result;
result=Chartoint();
system("pause");
return 0;
}