主題: Dev-C++問題
瀏覽單個文章
sioudon
Regular Member
 

加入日期: Aug 2005
文章: 94
引用:
作者lamand
第一次使用C語言的可用視窗的軟體Dev-C++以往都是使用DOS版本
並無一 些設定問題..麻煩各位有使用過此軟件大大們解惑
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include<stdio.h>
#include<math.h>
#include<conio.h>
#define randomize() srand((unsigned)time(NULL))
#define GLUT_DISABLE_ATEXIT_HACK
#include <GL/glut.h>
void srand(unsigned seed);
int main(int argc, char *argv[])
{
int i; -------------------------------------------------主程式
time_t t;
srand((unsigned)time(&t));
for(i=1;i<=5;i++)
{
printf("%-5d",rand());
printf("%8d",srand(time(0));<--錯這第19行--這航本是printf("%8d",random(50...



第19行最後少一個")" ,

正確的應該是:

printf("%8d",srand(time( 0 ) ) ) ;

問我朋友的@@"

他是"台大資工系"
 
舊 2007-09-04, 04:27 PM #2
回應時引用此文章
sioudon離線中