Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

videid / iax0583

  • This project
    • Loading...
  • Sign in
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 7 years ago by videid's avatar videid
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

lab8

parent a09b6011 master
Show whitespace changes
Inline Side-by-side
Showing 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
This diff is collapsed. Click to expand it.
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment