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
4183 KSL 05-Aug-2019 11:44:14 AM
4182 Ff 04-Aug-2019 05:11:19 AM
4181 T a lat 03-Aug-2019 05:51:12 AM
4180 sendgrid 02-Aug-2019 03:36:25 PM
4179 vacation 30-Jul-2019 09:11:24 PM
4178 Research pap 30-Jul-2019 04:20:20 PM
4177 post 29-Jul-2019 11:31:27 AM
4176 class1.cs 29-Jul-2019 11:25:42 AM
4175 defauaspx.cs 29-Jul-2019 11:25:14 AM
4174 class1.cs 29-Jul-2019 11:24:29 AM
4173 Hh 28-Jul-2019 10:53:33 PM
4172 link 26-Jul-2019 04:16:15 PM
4171 haris 26-Jul-2019 02:30:05 PM
4170 haris 26-Jul-2019 12:36:15 PM
4169 new-link 26-Jul-2019 01:00:05 AM
4168 Fadi_link 25-Jul-2019 01:30:06 AM
4167 fdc 24-Jul-2019 09:05:38 PM
4166 post 24-Jul-2019 03:28:49 PM
4165 papers 24-Jul-2019 12:05:13 PM
4164 link 24-Jul-2019 11:09:25 AM
4163 stack 2 23-Jul-2019 04:14:24 PM
4162 stack 23-Jul-2019 04:13:43 PM
4161 haris 22-Jul-2019 10:36:45 AM
4160 attan 22-Jul-2019 02:22:54 AM
4159 Hhh 21-Jul-2019 04:26:31 PM
4158 Ui 21-Jul-2019 12:22:09 PM
4157 Vv 21-Jul-2019 11:14:08 AM
4156 Ttt 21-Jul-2019 11:08:33 AM
4155 osman 18-Jul-2019 10:42:37 PM
4154 jam 18-Jul-2019 07:05:33 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