Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
videid
/
iax0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a17cc1a8
authored
Nov 15, 2017
by
videid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lab8
parent
a09b6011
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
lab8/lab8.C
lab8/lab8.C
0 → 100644
View file @
a17cc1a8
#include <time.h>
#include <stdlib.h>
#include <string.h>
int
main
(
void
)
{
int
so_random
(
seed
)
{
int
output
=
(
seed
*
(
seed
+
5737
))
%
10000
float
printf
(
"%f"
,
output
);
}
float
arr
[
1000
]
=
{};
for
(
i
=
0
;
i
=
1000
;
i
++
)
{
arr
[
i
]
=
so_random
(
i
)
begin
=
time
()
for
(
i
=
0
;
i
=
1000
;
i
++
)
{
for
(
j
=
0
;
j
=
1000
;
j
++
)
{
if
(
arr
[
j
]
>
arr
[
j
+
1
])
{
float
temp
=
arr
[
j
]
arr
[
j
]
=
array
[
j
+
1
]
arr
[
j
+
1
]
=
temp
}
}
}
}
end
=
time
()
printf
(
"%f"
,
end
-
begin
)
printf
(
"%f"
,
arr
)
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment