Programacion C
Enviado por oweerkt • 25 de Octubre de 2014 • 253 Palabras (2 Páginas) • 158 Visitas
#include<iostream>
#include<conio.h>
using namespace std;
int main(){
//PROBARLO TAL CUAL COMO ESTÁ, LUEGO LO MODIFICAN A SU GUSTO.
int x;
for( ;; ){
x=getch();
if(x==59) cout<<"jeje "; // en este caso F1. F2==60 F3==61 , ETC.
if(x==27)break; // Salir Al Pulsar La Letra Esc.
}
return 0;
}
#include <ctime>
#include <iostream>
using namespace std;
int main() {
time_t t = time(0); // get time now
struct tm * now = localtime( & t );
cout << (now->tm_year + 1900) << '-'
<< (now->tm_mon + 1) << '-'
<< now->tm_mday
<< endl;
}
#include <iostream>
#include <ctime>
using namespace std;
int main( )
{
// current date/time based on current system
time_t now = time(0);
cout << "Number of sec since January 1,1970:" << now << endl;
tm *ltm = localtime(&now);
// print various components of tm structure.
cout << "Year: "<< 1900 + ltm->tm_year << endl;
cout << "Month: "<< 1 + ltm->tm_mon<< endl;
cout << "Day: "<< ltm->tm_mday << endl;
cout << "Time: "<< 1 + ltm->tm_hour << ":";
cout << 1 + ltm->tm_min << ":";
cout << 1 + ltm->tm_sec << endl;
}
#include <iostream>
#include <windows.h>
using namespace std;
int main(){
int minutos, ii;
cout << "Minutos?" << endl;
cin >> minutos;
for(int j=minutos-1 ; j>= 0; j--){
ii = 59;
for(int i = ii; i >= 0; i--){
system("cls");
cout << j << ":" << i << endl;
cout << "\a";
Sleep(1000);
}
}
}
...