Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/02/2011, 14:34
Avatar de anacona16
anacona16
 
Fecha de Ingreso: marzo-2010
Ubicación: Bogota DC
Mensajes: 610
Antigüedad: 14 años, 8 meses
Puntos: 52
Se apaga PC al ejecutar programa en XP

Hola, tengo este programa en C++ que funiona perfectamente en W7 pero en XP si ejecuto el programa el PC se apaga

Código C++:
Ver original
  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <iostream>
  4. #include <time.h>
  5. #include <string>
  6.  
  7. using namespace std;
  8.  
  9. main (){
  10.  
  11.   int acertada=0,
  12.       errada=0;
  13.   string userInput,
  14.       respuestas[]={"24628213","413651","78897","1246","82465882","96423","42132589532","2466550","8456792","84652796","836980","64523579","46460","52163525","864579","53156800","46224657982","12225623300","2222246","222227848","5235586","9146378","1234560","987654","98456","85245635","85000","3456835770","34592347","8546789","3654250","2465780","951357536","65456321","9877896550","321123","25825800","9516540","7335791","42535","425000","954580400","46224466","245622530","245245","84698","963369","123475","965488","45678952","46246880","2465846","134879540","4624631","14600789","46791243","77216331","82128","2462","4223","127924","78825688","2223246","96488220","954863227","954863227","46128132","4224927","1145623","24357","1462490","24922","95487","6489","3654995","2499720","3400","194792","491246","4620","4997592","954220","246524","246524","7914632111","2222465","9513574","279524","2652740","2462466","795432","9613297","21625556","74613349","225648991","21322498","16792160","46131430","33881199440","5675320"};
  15.   char username[30];
  16.  
  17.     cout<<"\n\n BIENVENIDO AL TEST DE DIGITACION \n\n";
  18.     cout<<"\n\n Para llevar su registro, por favor digite su nombre ";
  19.     gets(username);
  20.  
  21.     time_t inicio,fin;
  22.     inicio=time(NULL);
  23.  
  24.   for(int i=0; i<100; i++){
  25.       cout<<"  " <<respuestas[i] << " : ";
  26.       cin>>userInput;
  27.       respuestas[i].compare(userInput)==0 ? acertada++ : errada++;
  28.   }
  29.  
  30.   cout<<"\n CALIFICACION DEL SEÑOR (A) " <<username;
  31.   cout<<"\n\n Respuestas acertadas: "<<acertada;
  32.   cout<<"\n\n Respuestas erradas: "<< errada;
  33.  
  34.   fin=time(NULL);
  35.   cout<<"\n Se demoro: "<<difftime(fin,inicio)<<" segundos";
  36.   getch ();
  37. }

Pueden ayudarme