Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- #include <windows.h>
- #include <conio.h>
- using namespace std;
- bool S1=false;
- bool S2=false;
- int turno=0,i;
- int h,cantI=0,Ckw=0,cantCkw=0,impulso=16000;
- void acumulador()
- {
- S1=true;
- turno=2;
- while(S2==true && turno==2)
- { cout<<endl;
- }
- Sleep(1000);
- cantI=i*impulso;
- S1=false;
- }
- void mostrar()
- {
- S2=true;
- turno=1;
- while(S1==true && turno==1)
- {
- cout<<endl;
- }
- Sleep(1000);
- Ckw=cantI/3200;
- cantCkw+=Ckw;
- cout<<"Se acumulo "<<cantI<<" impulsos en total"<<endl;
- cout<<"Se contabilizo "<<cantCkw<<" Kilowats"<<endl;
- S2=false;
- }
- int main()
- {
- int aux;
- cout<<"\t============\n"; cout<<endl;
- cout<<"Ingrese hora : ";
- cin>>h;
- cout<<endl;
- for(i=1; i<=h; i++)
- {
- Sleep(4000);
- cout<<"\nAcaba de pasar "<<i<<" hora(s) "<<endl;
- acumulador();
- mostrar();
- }
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement