-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpow.cpp
More file actions
51 lines (27 loc) · 734 Bytes
/
Copy pathpow.cpp
File metadata and controls
51 lines (27 loc) · 734 Bytes
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
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include<string.h>
int Pow (int x, int y){
if (y==0) return 1;
else if (y&1) return x * Pow (x, y-1);
else return Pow(x, y>>1)*Pow(x,y>>1);
}
int main(){
int a, b;
while (scanf("%d%d", &a, &b)!=EOF){
// clock_t t0, t1;
// t0= clock();
printf("%d\n",Pow(a,b));
// t1= clock();
// char s1[]="HilHi";
// char s2[]="Hi";
// char *s = strstr(s1,s2);
// char *ss = strstr (s1+strlen(s2), s2);
printf("%s", s);
printf("%s", ss);
// printf("%d\n", t1-t0/CLOCK_PER_SEC);
system("pause");
}
return 0;
}