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
4128 atif 28-Jun-2019 08:15:51 PM
4127 5second_2 28-Jun-2019 06:08:19 PM
4126 5second 28-Jun-2019 06:06:22 PM
4125 osman 27-Jun-2019 06:04:58 PM
4124 popup 27-Jun-2019 03:29:54 PM
4123 JDR 27-Jun-2019 03:17:35 PM
4122 apache 26-Jun-2019 04:44:37 PM
4121 fad_2 25-Jun-2019 10:15:22 PM
4120 fadi_1 25-Jun-2019 10:13:59 PM
4119 Fadi 25-Jun-2019 10:12:27 PM
4118 Assignment 25-Jun-2019 10:28:06 AM
4117 dsp fail 24-Jun-2019 04:52:57 PM
4116 rs100 24-Jun-2019 03:13:18 PM
4115 rs500 24-Jun-2019 03:12:59 PM
4114 rs1000 24-Jun-2019 03:12:20 PM
4113 interface 24-Jun-2019 03:11:51 PM
4112 demo 24-Jun-2019 03:10:50 PM
4111 JDR 23-Jun-2019 02:24:06 PM
4110 JDr 21-Jun-2019 11:55:22 AM
4109 JD image 20-Jun-2019 11:03:12 AM
4108 JDR backlink 19-Jun-2019 06:52:20 PM
4107 phne_verify 19-Jun-2019 12:41:59 PM
4106 non 17-Jun-2019 11:40:03 AM
4105 pak 16-Jun-2019 07:10:34 PM
4104 osman 14-Jun-2019 11:04:13 PM
4103 JDR 13-Jun-2019 08:59:27 PM
4102 shahmeee 13-Jun-2019 03:59:56 PM
4101 vectortt 13-Jun-2019 01:37:37 PM
4100 Zelay shah 12-Jun-2019 09:45:52 PM
4099 k1 11-Jun-2019 09:12:14 AM

[First] [Prev] 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 [Next] [Last]
 
web counter
web counter


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