C´òÓ¡ ´óÊýµÄ ½×³Ë
6000ÉõÖÁ10000£¬¶¼¿ÉÒÔ£¬µ«´óÓÚ6000£¬¾Í¿ªÊ¼¹öÆÁÁË¡£¡£
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
int i,j,*f,tmp,c=0;
long int n,bits;
const double PI=2*asin(1.0),E=exp(1.0);
scanf("%ld",&n);
bits=(long)ceil(n*(log10(n)-log10(E))+log10(2*PI*n)/2);
printf("there are %ld digits\n%ld!=",bits,n);
f=(int*)calloc(bits,sizeof(int));
f[0]=1;
for(i=2;i<=n;i++){
for(j=0;j<bits;j++){
tmp=f[j]*i+c;
c=tmp/10;
f[j]=tmp%10;
} }
for(i=bits-1;i>=0;i--) printf("%d",f[i]);
printf("\n");
return 0;
}
Ïà¹ØÎĵµ£º
Gcc¼ò½é
LinuxϵͳϵÄgcc£¨GNU C Compiler£©ÊÇGNUÍÆ³öµÄ¹¦ÄÜÇ¿´ó¡¢ÐÔÄÜÓÅÔ½µÄ¶àƽ̨±àÒëÆ÷£¬ÊÇGNUµÄ´ú±í×÷Æ·Ö®Ò»¡£gccÊÇ¿ÉÒÔÔÚ¶àÖÖÓ²ÌåÆ½Ì¨ÉϱàÒë³ö¿ÉÖ´ÐгÌÐòµÄ³¬¼¶±àÒëÆ÷£¬ÆäÖ´ÐÐЧÂÊÓëÒ»°ãµÄ±àÒëÆ÷Ïà±Èƽ¾ùЧÂÊÒª¸ß20%~30%¡£
gcc ±àÒëÆ÷Äܽ«C¡¢C++ÓïÑÔÔ´³ÌÐò¡¢»ã³Ìʽ»¯ÐòºÍÄ¿±ê³ÌÐò±àÒë¡¢Á¬½Ó³É¿ÉÖ´ÐÐÎļþ£¬Èç¹ûûÓи ......
/*ÓÃif¶à²ãǶÌ×ʵÏÖa£¬b£¬c´óСµÄÁùÖÖÅÅÐòÇé¿öa>b>c£¬a>c>b£¬c>a>b£¬c>b>a£¬b>c>a£¬b>a>c*/
#include<stdio.h>
void main()
{
unsigned int a,b,c;
printf("please input three numbers a,b,c:");
scanf("%d%d%d",&a,&b,&c);
if ......
³£¼ûµÄÔ¤´¦Àí¹¦ÄÜ£º Ô¤´¦ÀíÆ÷µÄÖ÷Òª×÷ÓþÍÊǰÑͨ¹ýÔ¤´¦ÀíµÄÄÚ½¨¹¦ÄܶÔÒ»¸ö×ÊÔ´½øÐеȼÛÌæ»»£¬×î³£¼ûµÄÔ¤´¦ÀíÓУºÎļþ°üº¬£¬Ìõ¼þ±àÒë¡¢²¼¾Ö¿ØÖƺͺêÌæ»»4ÖÖ¡£
Îļþ°üº¬£º#include ÊÇÒ»ÖÖ×îΪ³£¼ûµÄÔ¤´¦Àí£¬Ö÷ÒªÊÇ×öΪÎļþµÄÒýÓÃ×éºÏÔ´³ÌÐòÕýÎÄ¡£
Ìõ¼þ±àÒ룺#if£¬#ifndef£¬#ifdef ......
Visual C#ÊÇ΢Èí¹«Ë¾ÍÆ³öµÄÐÂÒ»´ú³ÌÐò¿ª·¢ÓïÑÔ£¬ÊÇ΢Èí.Net¿ò¼ÜÖеÄÒ»¸öÖØÒª×é³É²¿·Ö¡£ÆÁÄ»±£»¤³ÌÐòÊÇÒÔscrΪÀ©Õ¹ÃûµÄ±ê×¼Windows¿ÉÖ´ÐгÌÐò¡£ÆÁÄ»±£»¤³ÌÐò²»½ö¿ÉÒÔÑÓ³¤ÏÔʾÆ÷µÄʹÓÃÊÙÃü£¬»¹¿ÉÒÔ±£»¤Ë½ÈËÐÅÏ¢¡£±¾ÎÄÏò´ó¼Ò½éÉÜÒ»¸ö.Netƽ̨ÉÏÓÃC#±àдµÄÒ»¸ö¶¯Ì¬Îı¾¼°Í¼ÐÎµÄÆÁÄ»±£»¤³ÌÐò¡£
¡¡¡¡Ò»¡¢¾ßÌåʵÏÖ²½Ö裺
¡¡¡¡£ ......
Java 2 C++ http://www.javaeye.com/topic/295776
1. ½â¾öÐÔÄÜÎÊÌâ
Java¾ßÓÐÆ½Ì¨ÎÞ¹ØÐÔ£¬ÕâʹÈËÃÇÔÚ¿ª·¢ÆóÒµ¼¶Ó¦ÓõÄʱºò×ÜÊǰÑËü×÷ΪÖ÷ÒªºòÑ¡·½°¸Ö®Ò»£¬µ«ÊÇÐÔÄÜ·½ÃæµÄÒòËØÓÖ´ó´óÏ÷ÈõÁËËüµÄ¾ºÕùÁ¦¡£Îª´Ë£¬Ìá¸ßJavaµÄÐÔÄܾÍÏÔµÃÊ®·ÖÖØÒª¡£Sun¹«Ë¾¼°JavaµÄÖ§³ÖÕßÃÇΪÌá¸ßJavaµÄÔËÐÐËÙ¶ÈÒѾ×ö³öÁËÐí¶àŬÁ¦£¬ÆäÖдó¶àÊý¼¯ÖÐ ......