ÈçºÎÓÃC²úÉú0 99Ëæ»úÊý?
#include <stdlib.h>
#include<stdio.h>
#include<time.h>
#define randomize() srand((unsigned)time(NULL)) //¶¨ÒåÒ»¸öºê
int main(void)
{
int i;
printf("Ten random numbers from 0 to 99\n\n");
randomize();
for(i=0; i<100; i++)
{
printf("%d\n", rand() % 100);
sleep(1);
}
return 0;
}
<ÔËÐÐ>
root@farsight:/mnt/hgfs/E/yinhui/12.3/msg# gcc tttt.c -o tttt
root@farsight:/mnt/hgfs/E/yinhui/12.3/msg# ./tttt
Ten random numbers from 0 to 99
87
80
68
39
39
53
14
96
46
Ïà¹ØÎĵµ£º
²Ù×÷ϵͳµÄÒ»¸ö¾µäÎÊÌâÊÇ"Éú²úÕß-Ïû·ÑÕß"ÎÊÌâ, ÕâÉæ¼°Í¬²½ÐźÅÁ¿ºÍ»¥³âÐźÅÁ¿µÄÓ¦ÓÃ, ÔÚÕâÀï,ÎÒÓÃÏ̵߳Äͬ²½ºÍ»¥³âÀ´ÊµÏÖ.
/*
* author ÕÅÎÄ
* 2008/06/20
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h> ......
Data Type Ranges
C/C++ recognizes the types shown in the table below.
Type Name Bytes Other Names Range of Values
&nb ......
C³ÌÐòÖоßÓзḻµÄÊý¾ÝÀàÐÍ£¬°üÀ¨ÉùÃ÷ÖÐÏÔʽ¶¨ÒåµÄÀàÐͺÍÓÃ×ö±í´ïʽÖмäÀàÐ͵ĵ¼³öÀàÐÍ¡£ÀýÈ磬ÏÂÃæµÄ¸³ÖµÓï¾ä°üº¬3 ÖÖ²»Í¬ÀàÐÍ:
int *p, x;
*p = x;
xÊÇÒ»¸ö´æ·ÅÕûÊýµÄµ¥ÔªµÄµØÖ·£¬Òò´ËxµÄµØÖ·µÄÀàÐÍÊÇ£ºÖ¸ÏòÒ»¸öÕûÊýµÄÖ¸Õë¡£xµÄÖµµÄÀàÐÍÊÇÕûÐÍ¡£Í¬Ñù, pµÄ×óÖµµÄÀàÐÍÊÇÖ¸ÏòÒ»¸öÕ ......
It is better to have the ability of fast learning
ÓÐÒ»ÌìÄã覺µÃÉõ麼¶¼ÖªµÀÁË ¿É±¯
ÓÐÒ»ÌìÄã卻發現ÄãÉõ麼¶¼²»會 ¼ÓÓͰÉ
ÓÐÒ»ÌìÄã發現ÄãÓÖÉõ麼¶¼會ÁË 繼續
ÓÐÒ»ÌìÄã發現ÄãÉõ麼¶¼²»會ÁË ³É¹¦ÁË
......