°ïæ¿´Ò»ÏÂÕâ¸öc³ÌÐò(Çë´ó¼ÒÖ¸½Ì£© - C/C++ / CÓïÑÔ
±¾ÈËѧcÓïÑÔ²»¾Ã£¬¸ú×ÅÒ»±¾¡¶ANSI CÓ¦ÓóÌÐòÉè¼Æ¡·Ñ§Ï°±à³Ì£¬ÊéÖÐÓÐÒ»³ÌÐòÒªÇó£º
¶ÁÈëһϵÁи¡µãÊý£¬²¢´òÓ¡Ò»·Ýͳ¼Æ±¨¸æ£¬Áгö×î´ó£¬×îС£¬Æ½¾ùÖµ£¬×ܺͣ¬×ÜÌå·½²îºÍ¾ù·½²î£¬ÒÔÏÂΪ³ÌÐò´úÂ룺
[code=C/C++][/code]
#include<stdio.h>
#include<math.h>
void main()
{
float x,max,min,sum,ave,sum_of_squares,variance;
int count;
printf("Please input numbers\n");
if (scanf("%f",&x)==EOF)
{
printf("0 date has been inputed\n");
}
else
{
count=1;
sum=x;
max=x;
min=x;
sum_of_squares=x*x;
while(scanf("%f",&x)!=EOF)
{
count+=1;
sum+=x;
sum_of_squares+=x*x;
if(x>max)
max=x;
if(x<min)
min=x;
}
ave=sum/count;
variance=sum_of_squares/count-ave*ave;
printf("maximum value is=%f\n",max);
printf("minimum value is=%f\n",min);
printf("sum of all value is=%f\n",sum);
printf("average of all value is=%f\n",ave);
printf("variance is=%f\n",variance);
printf("deviation is=%f\n",sqrt(variance));
}
}
ÔÚvc++6.0ÖпÉÒÔ±àÒëͨ¹ý£¬µ«ÊÇÎÞ·¨ÏÔʾ½á¹û£¬debug¹ý·¢ÏÖ¼¸¸öÊýÖµ¶¼ÄÜËã³ö£¬µ«¾ÍÊDz»»áÏÔʾ×îºóµÄ½á¹û£¬ÄÜ°ïÎÒ½â¾öÒ»ÏÂÂð£¿Ð»Ð»£¡
[Quote=ÒýÓÃÂ¥Ö÷ marssteve µÄ»Ø¸´:]
±¾ÈËѧcÓïÑÔ²»¾Ã£¬¸ú×ÅÒ»±¾¡¶ANSI CÓ¦ÓóÌÐòÉè¼Æ¡·Ñ§Ï°±
Ïà¹ØÎÊ´ð£º
±¾ÈËÕýÔÚÓÃJava×öÒ»¸öC/S¼Ü¹¹µÄÏîÄ¿£¬
¿ÉÊÇÓÉÓÚÏîÄ¿±È½Ï´ó£¬Ç°ÆڶԼܹ¹µÄÉè¼ÆÓÈÆäÖØÒª£¬ÒòΪºóÆÚ¿ÉÄÜËæʱ»á¼Ó¸ö¹¦ÄÜ»òÕßÈ¥µôijЩ¹¦ÄÜ¡£
ËùÒÔÌصØÑ°ÇóÈçºÎÉè¼ÆC/SµÄ¼Ü¹¹Ê¹³ÌÐò¸ü¼ÓÃæÏò¶ÔÏó¸ü¼ÓÒ×ÓÚά ......
´ó¼ÒºÃ£º
ÎÒÏëʵÏÖ¼ì²âµ½²åÈëSD¿¨ºó×Ô¶¯½«SD¿¨¸ñʽ»¯µÄ¹¦ÄÜ£¬²»ÖªC/C++ÖÐÓÐûÓиñʽ»¯UÅ̵ĺ¯Êý£¿
ÁíÍ⣬ÎÒ²»ÏëʹÓÃSHFormatDrive£¬ÒòΪÕâ¸öº¯Êý»áµ¯³öÊÇ·ñÒª¸ñʽ»¯µÄÌáʾ¿ò£¬ÎÒÐèÒªµÄÊÇϵͳ×Ô¶¯¸ñʽ»¯£¬¶ø²Ù×÷Õß² ......
ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À²®ÎĵÄ×Ö¿âÄãÓÐô£¿
ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......
visual c++2008Ëٳɰ棬²»ÄܱàÒëC³ÌÐòÂð£¿Èç¹ûÄÜÊÇÔõô¿ªÊ¼µÄ°¡£¿ÓÃËü´øµÄÃüÁîÌáʾµ¥Ôª³ýÍâ ¡£
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£©
¾ø¶Ô¿ÉÒÔ¡£½¨Á¢win32¿ØÖÆ̨³ÌÐò¾Í¿ÉÒÔ
ÒýÓÃ
н¨¹¤³Ì£¨¿Õ¹¤³Ì»òwin32¿ØÖÆ̨£ ......