Está en la página 1de 2

/*

#include<iostream>
#include<stdlib.h>
using namespace std;
void main(){
int Q, b200, b100, b50, b20, b10;
cout<<"Ingrese el dinero a retirar :";cin>>Q;
b200=Q/200;
Q=Q%200;
b100=Q/100;
Q=Q%100;
b50=Q/50;
Q=Q%50;
b20=Q/20;
Q=Q%20;
b10=Q/10;
cout<<"Cantidad de billetes de 200 :"<<b200<<endl;
cout<<"Cantidad de billetes de 100 :"<<b100<<endl;
cout<<"cantidad de billetes de 50 :"<<b50<<endl;
cout<<"Cantidad de billetes de 20 :"<<b20<<endl;
cout<<"Cantidad de billetes de 10:"<<b10<<endl;
system("pause");
}
*/

#include<iostream>
#include<time.h>
#include<stdlib.h>
using namespace std;
void main(){
srand((unsigned)time(NULL));
int pc, yo;
cout<<"Tiro el dado y debe salir :";
cin>>yo;
pc=rand()%6+1;
if(pc==yo)
cout<<"ACERTE!!";
cout<<"El valor generado="<<pc<<endl;
system("pause");
}

#include<iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
void main(){
int A, B, C, M;
srand((unsigned)time(NULL));
cout<<"Tenemos estos valores aleatorios :"<<endl;
A=rand()%20+1;
B=rand()%20+1;
C=rand()%20+1;
cout<<"A :"<<A<<endl;
cout<<"B :"<<B<<endl;
cout<<"C :"<<C<<endl;
if(A>B){
if(A>C){
M=A;
}
else
M=C;
}
else{
if(B>C){
M=B;
}
else{
M=C;}
}
cout<<"El mayor es :"<<M<<endl;
system("pause");
}

#include<iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
void main(){
int A, B;
float X;
srand((unsigned)time(NULL));
cout<<"Se tiene la siguiente ecuacion "<<endl;
A=rand()%20;
B=rand()%20;
cout<<" "<<endl;
cout<<" "<<A<<"X + "<<B<<"=0"<<endl;
cout<<" "<<endl;
if(A=0){
cout<<"No hay solución";
}
else{
if(B=0){
X=0;
}
else
X=(-1.0)*B/A;}
cout<<"El valor de X es "<<X<<endl;
system("pause");
}

También podría gustarte