Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
69 lines (67 loc) · 845 Bytes

File metadata and controls

69 lines (67 loc) · 845 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#include<iostream>
using namespace std;
int main()
{
int ct, in;
cout<<"Enter the Count:";
cin>>ct;
cout<<"Enter the no. of Intervals:";
cin>>in;
int a[in][2];
cout<<endl<<"Enter the Intervals:";
for(int i = 0; i<in; i++)
{
for(int j = 0; j <2; j++)
{
cin>>a[i][j];
}
for(int i = 0; i <in; i++)
{
for(int j = 0; j <2; j++)
{
cout<<a[i][j];
}
for(int i = 0; i <ct; i++)
{
int t;
cout<<"Enter the arrival Timing:";
cin>>t;
if(t>a[in-1][1])
cout<<"Error";
else
{
for(int j = 0; j<in; j++)
{
int flag = 0;
for(int k = 0; k <2; k++)
{
int start, endpt;
if(k==0)
{
start = a[j][k];
endpt = a[j][k+1];
if(t>=start && t < endpt)
{
cout<<"Np Wait";
flag = 1;
}
else if(t < start)
{
cout<<"Wait for :"<<start-t;
flag = 1;
}
else if(t == endpt)
{
cout<<"Wair for :"<<(a[j+1][k]-t);
flag = 1;
}
}
}
if(flag == 1)
break;
}
}
}
cout<<in[in][1];
return 0;
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.