online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include<iostream> #include<cmath> using namespace std; float superficie(int l1, int l2, int l3); int main(void){ int n=20, arr[20], n1=n-1, n2=n-2, i, j, k, l1, l2, l3; float max=0, super; srand(time(NULL)); cout << ("Las 20 barras miden:\n"); for(i=0; i<n; i++) { arr[i] = 1+rand()%20; cout << arr[i] << " "; } for(i=0;i<n ; i++) for(j=i+1;j<n1; j++) for(k=j+1; k<n2; k++) if((arr[i]+arr[j])>=arr[k] && (arr[i]+arr[k])>=arr[j] && (arr[j]+arr[k])>=arr[i]){ super = superficie(arr[i], arr[j], arr[k]); if(super>max){ max = super; l1 = i; l2 = j; l3 = k; } } cout << "\n La superficie mรƒยกxima es:" << max << endl; cout << "Las barras son " << endl; cout << "barra:"<< l1 << " - " << arr[l1] << "; "; cout << "barra:"<< l2 << " - " << arr[l2] << "; "; cout << "barra:"<< l3 << " - " << arr[l3] << "; "; return 0; } float superficie(int l1, int l2, int l3){ float s = (l1+l2+l3)/2.0; return sqrt(s*(s-l1)*(s-l2)*(s-l3)); }

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