online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include<stdio.h> void printA(int a[5][3]); void sortBub(int a[5][3]); void sortSel(int a[5][3]); void swap(int a1[5], int a2[5]); int main() { // int a[5][3]={ 80,75,92,61,65,71,59,63,70,85,87,90,76,77,85 }; int a[5][3] = {{8, 4, 1},{8, 3, 2},{2, 4, 3},{6, 1, 4},{1, 5, 5}}; // int b[5] = {0, 1, 2, 3, 4}; // printA(a); // sortBub(a); printA(a); sortSel(a); printA(a); return 0; } void printA(int a[5][3]) { int i, j; for (i = 0; i < 5; i++) { for (j = 0; j < 3; j++) { printf("%5d", a[i][j]); } printf("\n"); } printf("\n"); } void sortBub(int a[5][3]) { int pass, i; for (pass = 0; pass < 5 - 1; pass++) { for (i = 0; i < 5 - pass - 1; i++) { // ζŒ‰η¬¬0δΈͺ元素比较倧小 if (a[i][0] > a[i + 1][0]) { swap(a[i], a[i + 1]); } } } } void sortSel(int a[5][3]) { int i, j; for (i = 0; i < 5; i++) { int min = i; for (j = i; j < 5; j++) { if (a[j][1] < a[min][1]) { min = j; } } swap(a[i], a[min]); } } void swap(int a1[5], int a2[5]) { int i, temp; for (i = 0; i < 3; i++) { temp = a1[i]; a1[i] = a2[i]; a2[i] = temp; } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue