online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <cstdlib> #include <time.h> using namespace std; int main() { srand(time(NULL)); int cartas[52], mano[5]; int i, j, k=52, l, m, a=1, b=k, aux=0, propAux1; for (i=0; i<52; i++) cartas[i] = (i%13)+1; for (i=0; i<52; i++) cout<<cartas[i]<<" "; cout<<endl<<endl; while(k>47){ //ASIGNAMOS UN VALOR ALEATORIO de entre [a, k] A "b" b = (rand()%(k-a+1)+a); mano[52-k] = cartas[b]; aux = cartas[k]; cartas[k] = cartas[b]; cartas[b] = aux; cout<<mano[52-k]<<" "<<endl; //k = k-1; k--; } for (i=0; i<52; i++) cout<<cartas[i]<<" "; cout<<endl<<endl; propAux1=0; for (l=0; l<5; l++) for (m=0; m<5; m++) if( cartas[l] == cartas[m] ) propAux1++; cout<<"hay "<<(propAux1-1)/2<<" pares"<<endl; return 0; }

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