第七课选做题。

This commit is contained in:
unlockable
2022-11-02 19:44:17 +08:00
parent 28898732bc
commit e5b23334fe
5 changed files with 183 additions and 0 deletions

12
07/Optional01.c Normal file
View File

@@ -0,0 +1,12 @@
#include <stdio.h>
#include <math.h>
int main() {
int i = 1;
double count = 0;
for (; i < 1001; i++) {
count += log10(i);
}
printf("1000! has %d digits.", ((int)count) + 1);
return 0;
}