-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsurprise_r2
More file actions
73 lines (57 loc) · 1.47 KB
/
surprise_r2
File metadata and controls
73 lines (57 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
#include <math.h>
#include <iomanip.h>
#include <time.h>
#include <string.h>
#define br getch();
void main()
{
clrscr();
//**********************************************************
time_t timer;
struct tm y2k = {0};
double seconds;
y2k.tm_hour = 0; y2k.tm_min = 0; y2k.tm_sec = 0;
y2k.tm_year = 100; y2k.tm_mon = 0; y2k.tm_mday = 1;
time(&timer); /* get current time; same as: timer = time(NULL) */
seconds = difftime(timer,mktime(&y2k));
//**********************************************************
cout<<" *** CyberBuzz 2k18 : Surprise Event *** "<<endl; br
//*****************************
cout<<" ** Round 2**"<<endl; br
double timeout;
//************************************************************************************
double answer_1,answer_2;
cout<<endl<<"Your x question:- "<<endl;
cout<<"There IS x penalty for wrong answer in this question"<<endl;
cout<<"abc"<<endl;
// *** Question 1
cout<<endl<<" Question goes here";
// ***
a:
cout<<"Type the answer: ";
cin>>answer_1;
// *** Answer 1
if (answer_1==11)
// ***
cout<<"Correct!"<<endl;
else
{
cout<<"Wrong Answer! You have been locked out for x seconds!"<<endl;
time(&timer);
seconds = difftime(timer,mktime(&y2k));
timeout=seconds+x;
while(seconds<timeout)
{
time(&timer);
seconds = difftime(timer,mktime(&y2k));
}
cout<<endl<<"x seconds have elapsed!"<<endl; br
goto a;
}
br
}