17 lines
286 B
C
17 lines
286 B
C
#include <math.h>
|
|
|
|
double pow10(int n) {
|
|
double result = 1.0;
|
|
|
|
if (n >= 0) {
|
|
for (int i = 0; i < n; i++) {
|
|
result *= 10.0;
|
|
}
|
|
} else {
|
|
for (int i = 0; i < -n; i++) {
|
|
result /= 10.0;
|
|
}
|
|
}
|
|
|
|
return result;
|
|
} |