-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom.cpp
More file actions
43 lines (35 loc) · 805 Bytes
/
random.cpp
File metadata and controls
43 lines (35 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* =====================================================================================
*
* Filename: random.cpp
*
* Description:
*
* Version: 1.0
* Created: 2015年06月23日 11时01分21秒
* Revision: none
* Compiler: gcc
*
* Author: zt (),
* Organization:
*
* =====================================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main ( int argc, char* argv[] )
{
srand ( time ( NULL ) );
int a = random() % 10;
//for ( int i = 0; i < 7 * 10; ++i )
for ( int i = 0; i < 7; ++i )
{
if ( ( i % 0x7 == 0 ) && ( i != 0 ) )
printf ( "\n" );
a = random() % 10;
printf ( "%02d ", a );
}
printf ( "\n" );
return 0;
}