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
4460 drop 21-Jan-2021 04:01:50 PM
4459 asda 21-Jan-2021 03:54:27 PM
4458 asda 21-Jan-2021 03:54:05 PM
4457 zeb.xml 20-Jan-2021 10:33:38 PM
4456 zeb 20-Jan-2021 10:32:54 PM
4455 WEBvIEW 20-Jan-2021 05:34:52 PM
4454 osm_phone 19-Jan-2021 05:47:37 PM
4453 ii 18-Jan-2021 02:03:04 PM
4452 Ikram audio 18-Jan-2021 01:17:34 PM
4451 AWS 17-Jan-2021 04:22:27 PM
4450 row.xml 15-Jan-2021 03:40:59 PM
4449 parm table 12-Jan-2021 04:05:42 PM
4448 andriod 08-Jan-2021 03:29:57 PM
4447 AMK2 08-Jan-2021 03:05:46 PM
4446 AMK 1 08-Jan-2021 03:05:25 PM
4445 link 07-Jan-2021 11:35:05 PM
4444 test 05-Jan-2021 10:24:22 AM
4443 file up flas 05-Jan-2021 10:23:49 AM
4442 NRG Benjyfis 04-Jan-2021 04:04:39 AM
4441 Os 01-Jan-2021 10:04:46 PM
4440 post 01-Jan-2021 12:16:39 PM
4439 afaq 01-Jan-2021 11:27:02 AM
4438 python_flask 28-Dec-2020 02:05:29 AM
4437 link 24-Dec-2020 03:27:25 PM
4436 internet 16-Dec-2020 06:08:27 PM
4435 http 16-Dec-2020 06:05:59 PM
4434 uuu 14-Dec-2020 10:36:15 AM
4433 dd 12-Dec-2020 11:00:00 PM
4432 23 12-Dec-2020 10:54:41 PM
4431 94 12-Dec-2020 10:40:18 PM

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