viernes, 25 de enero de 2013

switch


#include <iostream>
using namespace std;

main()
{
  int mes=0;
cout << "Ingrese el mes ";
cin >> mes;
switch(mes) {
case 1:
cout<<"Enero";
break;
case 2:
cout<<"Febrero";
break;
case 3:
cout<<"Marzo";
break;
case 4:
cout<<"Abril";
break;
case 5:
cout<<"Mayo";
break;
default:
cout<<"Otro";
break;
}
}


jueves, 24 de enero de 2013

256 colores

#include <graphics.h>
#include <conio.h>

int huge DetectVga256(){
return 0;
}

int main(void)
{
int modo = DETECT, tarj ;

installuserdriver("SVGA256",DetectVga256);
initgraph(&modo, &tarj, "");


for(int x=0;x<=310;x++){
setcolor(x);
line(x,0,x,100);
}

   getch();
   return 0;
}