hdu 1018

来源:互联网 发布:数据库系统原理答案 编辑:程序博客网 时间:2024/05/29 18:45
这道题我是百度的,数论一点也不会 = =
#include<stdio.h>#include<math.h>#define pi 3.14159265int num,result;void JC(){    double t;    t = (num*log(num) - num + 0.5*log(2*num*pi))/log(10);    result = (int)t+1;    printf("%d\n",result);}int main(){    int i,n;    scanf("%d",&n);    for( i=0 ; i<n ; i++ )      {   scanf("%d",&num);    JC();} return 0;}