ÈçºÎÓÃ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
Ïà¹ØÎĵµ£º
Data Type Ranges
C/C++ recognizes the types shown in the table below.
Type Name Bytes Other Names Range of Values
&nb ......
ÔÚÕâÀïÌùÉÏ×î½ü×Ô¼ºÃ¦»îµÄÓÃturbo C±àдµÄ“´ò×ÖÓÎÏ·”µÄÔ´´úÂ룺
#include<graphics.h>
#include<conio.h>
#include<STDLIB.h>
#include<dos.h>
#define BK_COLOR BLACK
#define CHAR_COLOR WHITE
#define C_COLOR BLUE
#define num 10
#define SPEED 3000
#define Esc 27
# ......
1.ÒýÑÔ
¡¡¡¡C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌØµã£¨±»ÊÀÈ˳ÆÎª“²»³¹µ×µØÃæÏò¶ÔÏ󔣩£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚÈκÎÀàµÄÈ«¾Ö±äÁ¿ºÍº¯Êý¡£µ«ÊÇ£¬C++±Ï¾ ......
±ê×¼C¿ØÖÆÌ¨³ÌÐòÒ²¿ÉÒÔ×Ô¶¨ÒåÎÄ×ÖÊä³öÑÕÉ«£¬ÈôòÓ¡ÐÅÏ¢¸üÏÊÃ÷£¬ÔÚdebugµÄʱºòÌØ±ðÓÐÓ᣷½·¨ºÜ¼òµ¥£º
ת×Ô£ºhttp://www.diybl.com/course/3_program/c/c_js/20090303/157456.html
ÏÈ´ÓÒ»¸öÀý×Ó¿ªÊ¼
printf("\033[31m ####----->> \033[32m" "hello\n" "\033[m");
ÑÕÉ«·ÖΪ±³¾°É«ºÍ×ÖÌåÉ«£¬30~39ÓÃÀ´ÉèÖÃ×ÖÌåÉ« ......