Академический Документы
Профессиональный Документы
Культура Документы
#include<stdio.h>
int main()
char op;
do
do
scanf("%d", &n);
a[0]=n/1000;
a[1]=(n%1000)/100;
a[2]=(n%100)/10;
a[3]=n%10;
r=evaluacion(a);
while(n!=6174)
{
b[j]=a[j];
ordenascendente(b);
nummenor=b[0]*1000+b[1]*100+b[2]*10+b[3];
nummayor=b[0]+b[1]*10+b[2]*100+b[3]*1000;
n=nummayor-nummenor;
a[0]=n/1000;
a[1]=(n%1000)/100;
a[2]=(n%100)/10;
a[3]=n%10;
op=toupper(getch());
system("cls");
while(op=='1');
return 0;
int s=0, j;
if(d[0]==d[j])
{
s++;
return s;
if(c[j]>c[j+1])
aux=c[j];
c[j]=c[j+1];
c[j+1]=aux;
#include <stdio.h>
#include <stdlib.h>
#include<time.h>
#include<windows.h>
int main()
srand(time(NULL));
int Posicion_Tortuga = 1;
int tortuga = 1;
int Posicion_Liebre = 1;
int liebre = 1;
int centinela = 0;
int x;
printf("\n\t\t\t\tBANG!");
printf("\n\t\t\t Y ARRANCAN!");
while ( 0 == centinela )
Sleep(1000);
Pista[x] = '0';
tortuga = Posicion_Tortuga;
liebre = Posicion_Liebre;
if ( 'E' == Pista[tortuga])
Imprime_Pista( Pista, 70 );
if ( Posicion_Liebre >= 70 )
if ( Posicion_Tortuga> 70)
else
if ( Posicion_Tortuga >= 70 )
{
if ( Posicion_Liebre < 70)
else
return 0;
//////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
int i;
printf("\n");
if ( '0' == A[i] )
printf(" ");
else
printf("%c", A[i]);
}
/////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
int ruleta;
ruleta = 1+rand()%10;
if ( 2 >= ruleta )
return l;
if ( 4 >= ruleta )
return (l + 9);
if ( 5 >= ruleta )
return l - 12;
if ( 8 >= ruleta )
return l + 1;
if ( 10 >= ruleta )
return l - 2;
///////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
int dados;
dados = 1+rand()%10;
if ( 5 >= dados )
return t + 3;
if ( 7 >= dados )
return t - 6;
if ( 10 >= dados )
return t + 1;
int s=0;
c[d] = 'L';
if ( d < 1 )
d = 1;
c[d] = 'L';
if ( e == d )
c[e] = 'E';
}
else
c[e] = 'T';
if ( e < 1 )
e = 1;
if ( d == 1 )
c[e] = 'E';
else
c[e] = 'T';
if ( d >= 70 )
s = -1;
if ( e >= 70 )
s = -1;
return s;
}
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
char oc;
srand(time(NULL));
do
system("cls");
do
printf("\n4-Salir..");
scanf("%d", &op);
while(op>4 || op<1);
if(op<4)
do
scanf("%d", &n);
while(n<1);
int v[n];
int a[n];
llenar(v, n);
os=op;
switch(op)
case 1:
b=primos(v, a, n);
impresion(v, n);
eliminarrepetidos(a, b);
printf("\n");
impresion(a, b);
break;
case 2:
b=compuestos(v, a, n);
impresion(v, n);
eliminarrepetidos(a, b);
impresion(a, b);
break;
case 3:
impresion(v, n);
break;
do
printf("\n\nIngrese su opcion:");
scanf("%s", &oc);
switch(oc)
if(os==3)
{
ordenascendente(v, n);
impresion(v, n);
else
ordenascendente(a, b);
impresion(a, b);
break;
if(os==3)
ordendescendente(v, n);
impresion(v, n);
else
ordendescendente(&a[0], b);
impresion(&a[0], b);
break;
}
getch();
while(op!=4);
getch();
return 0;
int i;
c[i]=2+rand()%198;
acum=0;
if(d[i]%r==0)
acum=acum+r;
}
if(acum==d[i]+1)
e[j]=d[i];
j++;
con++;
return con;
acum=0;
if(f[i]%r==0)
acum=acum+r;
if(acum!=f[i]+1)
{
g[j]=f[i];
j++;
con++;
return con;
if ( h[ i ] > h[ i + 1 ] )
aux = h[ i ];
h[ i ] = h[ i + 1 ];
h[ i + 1 ] = aux;
if ( k[ i ] < k[ i + 1 ] )
aux = k[ i ];
k[ i ] = k[ i + 1 ];
k[ i + 1 ] = aux;
int i, j;
if(y[i]==y[j])
y[j]=0;
}
}
int i;
printf("\n");
if(m[i]!=0)
}
Vendedores
#include<stdio.h>
#include<stdlib.h>
void iniciar_bid();
void lectura_ventas();
void totalizar_columnas();
void totalizar_filas();
int validar_num();
int mat[COLUMNAS][FILAS];
int mat_col[COLUMNAS];//Vendedores
int mat_fil[FILAS];//Productos
int main()
iniciar_bid();
lectura_ventas();
totalizar_columnas();//Vendedores
totalizar_filas();//Productos
void iniciar_bid()
int i, j;
for (i = 0; j < COLUMNAS; i++)
mat[i][j] = 0;
void lectura_ventas()
int i, j;
mat[i][j]= validar_num();
printf("\n");
void totalizar_columnas()
int i, j;
mat_col[i] = 0;
printf("\n");
void totalizar_filas()
int i, j;
mat_col[j] = 0;
mat_col[j] += mat[i][j];
int validar_num ()
int num;
do
scanf("%d", &num);