powerunlimited

[1021]工程程式設計_HW2-1

Oct 27th, 2013
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <stdlib.h>
  4. #include <time.h>
  5.  
  6. using namespace std ;
  7.  
  8. int main() {
  9.     float num1;
  10.     srand(time(NULL));
  11.     cout << "產生一個介於[0,54.00]"<<endl;
  12.     num1=(rand()% 5401);
  13.     num1=num1/100;
  14.     cout << num1<<endl;
  15.          
  16.        
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment