Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

새싹교실/2017/내무반/박채린/BubbleSort: Difference between revisions

From ZeroWiki
({CREATE})
 
imported>love_ev_v
No edit summary
Line 1: Line 1:
#include<stdio.h>
#include <stdio.h>


void main() {
void main() {

Revision as of 17:52, 15 May 2017

  1. include <stdio.h>

void main() { int temp, i, j; int arr[] = { 55,07,78,12,42 };

for (i = 4; i >= 1; i--) { for (j = 1; j <= i; j++) if (arrj - 1 > arr[j]) { temp = arrj - 1; arrj - 1 = arr[j]; arr[j] = temp; } }

for (i = 0; i < 5; i++) printf("%d\n", arr[i]);

return 0; }