Copy and Paste  -   An Application to Copy/Paste Text  

 
S.No 4372 Name Cyanide Date/Time 06-May-2020 01:41:09 PM

Copy text from below
//============================================================================
// Name : DelSequence.cpp
// Author : MLG_PeppaPig
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>

using namespace std;
int SIZE_SENTENCE {0};
int SIZE_KEY {0};
char sentence[] = "This is data structures and algorithm course";
char key[] = "data";

int findKey();
int main() {
SIZE_SENTENCE = sizeof(sentence);
SIZE_KEY = sizeof(key);
int kStart=0;
kStart = findKey();
//Re Arrange Sentence String to Remove KEY
for (int i=kStart; i<SIZE_SENTENCE; i++)
{
if (i+SIZE_KEY-1 < SIZE_SENTENCE)
sentence[i-1] = sentence[i+SIZE_KEY-1];
}
cout << sentence;
return 0;
}
int findKey()
{
int kStart = 0;
bool found = false;
int j;
int innerIterator;
//Loop to iterate to find starting point of KEY
for (int i=0; i<SIZE_SENTENCE;i++)
{
j=0;
if (sentence[i] == key[j])
{
kStart=i;
innerIterator = i;
//Loop to confirm that key exists
for (int k=0; k<SIZE_KEY; k++)
{
if (sentence[innerIterator++] == key[j])
{
j++;
if (j == SIZE_KEY-1)
found = true;
}
}
}
//Flag to exit loop if an instance of key found
if (found)
break;
}
return kStart;
}




comments powered by Disqus
NEW ENTRIES
S.No Name Entry Time/Date
4370 globalloacal 03-May-2020 05:50:07 PM
4369 zain 03-May-2020 05:49:14 PM
4368 sfr 27-Apr-2020 01:07:48 AM
4367 za 26-Apr-2020 02:17:14 PM
4366 shahbaz 20-Apr-2020 03:05:16 PM
4365 resoultion 13-Apr-2020 02:50:16 AM
4364 Mac command 13-Apr-2020 02:47:04 AM
4363 test 05-Apr-2020 01:29:07 AM
4362 a 24-Mar-2020 11:44:12 AM
4361 Checkout 23-Mar-2020 03:15:04 PM
4360 Maleeha 14-Mar-2020 09:45:42 AM
4359 OOP-CIT 11-Mar-2020 04:51:40 PM
4358 mansoor 10-Mar-2020 03:59:44 PM
4355 cc 02-Mar-2020 06:52:22 PM
4354 B 02-Mar-2020 06:04:56 PM
4353 A 02-Mar-2020 06:04:20 PM
4352 kiyani 26-Feb-2020 08:37:50 PM
4351 nouman 23-Feb-2020 12:22:48 PM
4350 Txttttt 22-Feb-2020 09:05:06 PM
4349 ososos 04-Feb-2020 09:41:21 PM
4348 Winters 25-Jan-2020 12:25:20 PM
4347 Winters 24-Jan-2020 04:26:44 PM
4346 Mansoor 22-Jan-2020 12:03:07 PM
4345 aa 16-Jan-2020 04:58:57 PM
4344 Blog 15-Jan-2020 12:50:12 AM
4343 ffff 13-Jan-2020 11:59:31 AM
4342 cssfile 08-Jan-2020 01:28:22 PM
4341 link 07-Jan-2020 01:13:47 PM
4340 component.ts 07-Jan-2020 01:12:12 PM
4339 op.html 07-Jan-2020 01:11:00 PM

[First] [Prev] 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 [Next] [Last]
 
web counter
web counter


To report any error messages or bugs, or other issues, please send email at: info@pakproject.com