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
4278 check 11-Nov-2019 09:36:22 AM
4277 Alaska 11-Nov-2019 01:54:08 AM
4276 Ps 09-Nov-2019 12:00:39 PM
4275 Ps 09-Nov-2019 11:57:50 AM
4274 Ahmed 09-Nov-2019 10:12:24 AM
4273 dsp new 08-Nov-2019 10:20:35 AM
4272 dsp 08-Nov-2019 10:08:23 AM
4271 dspsss 08-Nov-2019 10:08:03 AM
4270 SKU 06-Nov-2019 02:39:21 PM
4269 ibrahim 06-Nov-2019 12:01:49 PM
4268 ibrahim 06-Nov-2019 12:01:29 PM
4267 ibrahim 06-Nov-2019 12:01:06 PM
4266 ibrahim 06-Nov-2019 12:00:46 PM
4265 ibrahim 06-Nov-2019 12:00:29 PM
4264 ibrahim 06-Nov-2019 12:00:11 PM
4263 ibrahim 06-Nov-2019 11:59:50 AM
4262 sir g link a 06-Nov-2019 10:36:54 AM
4261 Grade_Func 04-Nov-2019 03:01:55 PM
4260 Grade_Query 04-Nov-2019 02:35:05 PM
4259 mysql conn 04-Nov-2019 12:44:32 PM
4258 xml file 04-Nov-2019 12:37:37 PM
4257 fazhhh 04-Nov-2019 11:55:34 AM
4256 usman 03-Nov-2019 11:29:24 AM
4255 CUBING 02-Nov-2019 11:32:03 PM
4254 ppaer 01-Nov-2019 11:53:36 AM
4253 paper 01-Nov-2019 11:53:13 AM
4252 fiverr 31-Oct-2019 09:28:37 PM
4251 zaid 30-Oct-2019 12:03:45 PM
4250 shoaib 30-Oct-2019 10:02:49 AM
4249 cm 28-Oct-2019 10:13:32 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