test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
72
.config/Code/User/History/-6707eb3c/07LE.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/07LE.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
58
.config/Code/User/History/-6707eb3c/0pDB.cpp
Normal file
58
.config/Code/User/History/-6707eb3c/0pDB.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<109;i++){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
35
.config/Code/User/History/-6707eb3c/1DvF.cpp
Normal file
35
.config/Code/User/History/-6707eb3c/1DvF.cpp
Normal file
|
@ -0,0 +1,35 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
75
.config/Code/User/History/-6707eb3c/3H0V.cpp
Normal file
75
.config/Code/User/History/-6707eb3c/3H0V.cpp
Normal file
|
@ -0,0 +1,75 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k<dictionary[j].length();k++){
|
||||
if(matrix[k/numColumns][k%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match){
|
||||
cout<<dictionary[j]<<endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/5uE9.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/5uE9.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k<dictionary[j].length();k++){
|
||||
if(matrix[k/numColumns][k%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
65
.config/Code/User/History/-6707eb3c/6fHF.cpp
Normal file
65
.config/Code/User/History/-6707eb3c/6fHF.cpp
Normal file
|
@ -0,0 +1,65 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/7NdH.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/7NdH.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/82HM.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/82HM.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numRows] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
46
.config/Code/User/History/-6707eb3c/9Llp.cpp
Normal file
46
.config/Code/User/History/-6707eb3c/9Llp.cpp
Normal file
|
@ -0,0 +1,46 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
33
.config/Code/User/History/-6707eb3c/9z2c.cpp
Normal file
33
.config/Code/User/History/-6707eb3c/9z2c.cpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
private:
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
70
.config/Code/User/History/-6707eb3c/A2Xl.cpp
Normal file
70
.config/Code/User/History/-6707eb3c/A2Xl.cpp
Normal file
|
@ -0,0 +1,70 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool equal(string str1, string str2){
|
||||
if(str1.length() != str2.length()) return false;
|
||||
for(int i=0;i<str1.length();i++){
|
||||
if(str1[i] != str2[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
70
.config/Code/User/History/-6707eb3c/B8oi.cpp
Normal file
70
.config/Code/User/History/-6707eb3c/B8oi.cpp
Normal file
|
@ -0,0 +1,70 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
50
.config/Code/User/History/-6707eb3c/D5dt.cpp
Normal file
50
.config/Code/User/History/-6707eb3c/D5dt.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
58
.config/Code/User/History/-6707eb3c/DkKP.cpp
Normal file
58
.config/Code/User/History/-6707eb3c/DkKP.cpp
Normal file
|
@ -0,0 +1,58 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<109;i++){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/FfpP.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/FfpP.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numColumns][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
76
.config/Code/User/History/-6707eb3c/Hbv0.cpp
Normal file
76
.config/Code/User/History/-6707eb3c/Hbv0.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k<dictionary[j].length();k++){
|
||||
if(matrix[k/numColumns][k%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match){
|
||||
cout<<dictionary[j]<<endl;
|
||||
i += dictionary[j].length()-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/L4Ib.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/L4Ib.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numColumns][i%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/LmZ7.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/LmZ7.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
for(int k=0;k<109;k++){
|
||||
if(matrix[i][j] == dictionary[k][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool equal(string str1, string str2){
|
||||
if(str1.length() != str2.length()) return false;
|
||||
for(int i=0;i<str1.length();i++){
|
||||
if(str1[i] != str2[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
62
.config/Code/User/History/-6707eb3c/Meew.cpp
Normal file
62
.config/Code/User/History/-6707eb3c/Meew.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][k])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
68
.config/Code/User/History/-6707eb3c/NX3p.cpp
Normal file
68
.config/Code/User/History/-6707eb3c/NX3p.cpp
Normal file
|
@ -0,0 +1,68 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
for(int k=0;k<109;k++){
|
||||
if(matrix[i][j] == dictionary[k][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool equal(string str1, string str2){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
62
.config/Code/User/History/-6707eb3c/OlBa.cpp
Normal file
62
.config/Code/User/History/-6707eb3c/OlBa.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
71
.config/Code/User/History/-6707eb3c/OsDI.cpp
Normal file
71
.config/Code/User/History/-6707eb3c/OsDI.cpp
Normal file
|
@ -0,0 +1,71 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
for(int k=0;k<109;k++){
|
||||
if(matrix[i][j] == dictionary[k][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool equal(string str1, string str2){
|
||||
if(str1.length() != str2.length()) return false;
|
||||
for(int i=0;i<str1.length();i++){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
66
.config/Code/User/History/-6707eb3c/POOW.cpp
Normal file
66
.config/Code/User/History/-6707eb3c/POOW.cpp
Normal file
|
@ -0,0 +1,66 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/RieW.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/RieW.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/VnP8.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/VnP8.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numColumns + k][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/WzG6.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/WzG6.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numRows][i%numRows] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
50
.config/Code/User/History/-6707eb3c/ZCfe.cpp
Normal file
50
.config/Code/User/History/-6707eb3c/ZCfe.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
cin>>matrix[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
64
.config/Code/User/History/-6707eb3c/Zmn0.cpp
Normal file
64
.config/Code/User/History/-6707eb3c/Zmn0.cpp
Normal file
|
@ -0,0 +1,64 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
for(int k=0;k<109;k++){
|
||||
if(matrix[i][j] == dictionary[k][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
76
.config/Code/User/History/-6707eb3c/eXlT.cpp
Normal file
76
.config/Code/User/History/-6707eb3c/eXlT.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k-i<dictionary[j].length();k++){
|
||||
if(matrix[k/numColumns][k%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match){
|
||||
cout<<dictionary[j]<<endl;
|
||||
i += dictionary[j].length()-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
1
.config/Code/User/History/-6707eb3c/entries.json
Normal file
1
.config/Code/User/History/-6707eb3c/entries.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/lab10/lab10.cpp","entries":[{"id":"9z2c.cpp","timestamp":1711941785505},{"id":"pD8R.cpp","timestamp":1711941810848},{"id":"1DvF.cpp","timestamp":1711941854814},{"id":"hvxx.cpp","timestamp":1711941873971},{"id":"u91R.cpp","timestamp":1711941901391},{"id":"qBwq.cpp","timestamp":1711941917941},{"id":"9Llp.cpp","timestamp":1711941930548},{"id":"D5dt.cpp","timestamp":1711941958038},{"id":"ZCfe.cpp","timestamp":1711941989934},{"id":"tnt7.cpp","timestamp":1711942009464},{"id":"wfa4.cpp","timestamp":1711942084298},{"id":"ohim.cpp","timestamp":1711942096108},{"id":"o7fi.cpp","timestamp":1711942187485},{"id":"0pDB.cpp","timestamp":1711942322288},{"id":"DkKP.cpp","timestamp":1711942391224},{"id":"sbNz.cpp","timestamp":1711942411804},{"id":"Zmn0.cpp","timestamp":1711942433031},{"id":"NX3p.cpp","timestamp":1711942448347},{"id":"OsDI.cpp","timestamp":1711942475474},{"id":"LmZ7.cpp","timestamp":1711942531204},{"id":"xOw1.cpp","timestamp":1711942544114},{"id":"kASb.cpp","timestamp":1711942638434},{"id":"lWrj.cpp","timestamp":1711942658541},{"id":"vVhc.cpp","timestamp":1711942887914},{"id":"A2Xl.cpp","timestamp":1711942936988},{"id":"OlBa.cpp","timestamp":1711942956231},{"id":"nbE7.cpp","timestamp":1711943204652},{"id":"vNb8.cpp","timestamp":1711943232039},{"id":"Meew.cpp","timestamp":1711943244802},{"id":"6fHF.cpp","timestamp":1711943437905},{"id":"POOW.cpp","timestamp":1711943448445},{"id":"B8oi.cpp","timestamp":1711943498948},{"id":"lbZS.cpp","timestamp":1711943530908},{"id":"07LE.cpp","timestamp":1711943558888},{"id":"7NdH.cpp","timestamp":1711943813775},{"id":"WzG6.cpp","timestamp":1711944122089},{"id":"82HM.cpp","timestamp":1711944132719},{"id":"qmZq.cpp","timestamp":1711944143732},{"id":"RieW.cpp","timestamp":1711944175746},{"id":"FfpP.cpp","timestamp":1711944303636},{"id":"VnP8.cpp","timestamp":1711944535076},{"id":"L4Ib.cpp","timestamp":1711944565520},{"id":"5uE9.cpp","timestamp":1711944576090},{"id":"3H0V.cpp","timestamp":1711944785044},{"id":"o8Gx.cpp","timestamp":1711945162308},{"id":"Hbv0.cpp","timestamp":1711945386392},{"id":"eXlT.cpp","timestamp":1711945782690},{"id":"tdFK.cpp","timestamp":1711945944374},{"id":"qJkw.cpp","timestamp":1711946691619},{"id":"xXT3.cpp","timestamp":1711958150147}]}
|
39
.config/Code/User/History/-6707eb3c/hvxx.cpp
Normal file
39
.config/Code/User/History/-6707eb3c/hvxx.cpp
Normal file
|
@ -0,0 +1,39 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
66
.config/Code/User/History/-6707eb3c/kASb.cpp
Normal file
66
.config/Code/User/History/-6707eb3c/kASb.cpp
Normal file
|
@ -0,0 +1,66 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool equal(string str1, string str2){
|
||||
if(str1.length() != str2.length()) return false;
|
||||
for(int i=0;i<str1.length();i++){
|
||||
if(str1[i] != str2[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/lWrj.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/lWrj.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
for(int k=0;k<109;k++){
|
||||
if(matrix[i][j] == dictionary[k][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool equal(string str1, string str2){
|
||||
if(str1.length() != str2.length()) return false;
|
||||
for(int i=0;i<str1.length();i++){
|
||||
if(str1[i] != str2[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/lbZS.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/lbZS.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 3);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
60
.config/Code/User/History/-6707eb3c/nbE7.cpp
Normal file
60
.config/Code/User/History/-6707eb3c/nbE7.cpp
Normal file
|
@ -0,0 +1,60 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
56
.config/Code/User/History/-6707eb3c/o7fi.cpp
Normal file
56
.config/Code/User/History/-6707eb3c/o7fi.cpp
Normal file
|
@ -0,0 +1,56 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
76
.config/Code/User/History/-6707eb3c/o8Gx.cpp
Normal file
76
.config/Code/User/History/-6707eb3c/o8Gx.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k<dictionary[j].length();k++){
|
||||
if(matrix[k/numColumns][k%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match){
|
||||
cout<<dictionary[j]<<endl;
|
||||
i += dictionary[j].length();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
52
.config/Code/User/History/-6707eb3c/ohim.cpp
Normal file
52
.config/Code/User/History/-6707eb3c/ohim.cpp
Normal file
|
@ -0,0 +1,52 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
32
.config/Code/User/History/-6707eb3c/pD8R.cpp
Normal file
32
.config/Code/User/History/-6707eb3c/pD8R.cpp
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
42
.config/Code/User/History/-6707eb3c/qBwq.cpp
Normal file
42
.config/Code/User/History/-6707eb3c/qBwq.cpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
76
.config/Code/User/History/-6707eb3c/qJkw.cpp
Normal file
76
.config/Code/User/History/-6707eb3c/qJkw.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k-i<dictionary[j].length() && k<numRows*numColumns;k++){
|
||||
if(matrix[k/numColumns][k%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match){
|
||||
cout<<dictionary[j]<<endl;
|
||||
i += dictionary[j].length()-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/qmZq.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/qmZq.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
if(matrix[i/numRows][i%numColumns] != dictionary[j][k]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match) cout<<dictionary[j]<<endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
62
.config/Code/User/History/-6707eb3c/sbNz.cpp
Normal file
62
.config/Code/User/History/-6707eb3c/sbNz.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
for(int k=0;k<109;k++){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
76
.config/Code/User/History/-6707eb3c/tdFK.cpp
Normal file
76
.config/Code/User/History/-6707eb3c/tdFK.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k-i<dictionary[j].length() && k<numRows*numColumns;k++){
|
||||
if(matrix[k/numColumns][k%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match){
|
||||
cout<<dictionary[j]<<endl;
|
||||
i += dictionary[j].length()-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
47
.config/Code/User/History/-6707eb3c/tnt7.cpp
Normal file
47
.config/Code/User/History/-6707eb3c/tnt7.cpp
Normal file
|
@ -0,0 +1,47 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
40
.config/Code/User/History/-6707eb3c/u91R.cpp
Normal file
40
.config/Code/User/History/-6707eb3c/u91R.cpp
Normal file
|
@ -0,0 +1,40 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix = new char[numColumns];
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
62
.config/Code/User/History/-6707eb3c/vNb8.cpp
Normal file
62
.config/Code/User/History/-6707eb3c/vNb8.cpp
Normal file
|
@ -0,0 +1,62 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
if(matrix[i/numRows][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=1;k<dictionary[j].length();k++){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
66
.config/Code/User/History/-6707eb3c/vVhc.cpp
Normal file
66
.config/Code/User/History/-6707eb3c/vVhc.cpp
Normal file
|
@ -0,0 +1,66 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
bool equal(string str1, string str2){
|
||||
if(str1.length() != str2.length()) return false;
|
||||
for(int i=0;i<str1.length();i++){
|
||||
if(str1[i] != str2[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
51
.config/Code/User/History/-6707eb3c/wfa4.cpp
Normal file
51
.config/Code/User/History/-6707eb3c/wfa4.cpp
Normal file
|
@ -0,0 +1,51 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
72
.config/Code/User/History/-6707eb3c/xOw1.cpp
Normal file
72
.config/Code/User/History/-6707eb3c/xOw1.cpp
Normal file
|
@ -0,0 +1,72 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows;i++){
|
||||
for(int j=0;j<numColumns;j++){
|
||||
for(int k=0;k<109;k++){
|
||||
if(matrix[i][j] == dictionary[k][0]){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool equal(string str1, string str2){
|
||||
if(str1.length() != str2.length()) return false;
|
||||
for(int i=0;i<str1.length();i++){
|
||||
if(str1[i] != str2[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
return 0;
|
||||
}
|
76
.config/Code/User/History/-6707eb3c/xXT3.cpp
Normal file
76
.config/Code/User/History/-6707eb3c/xXT3.cpp
Normal file
|
@ -0,0 +1,76 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class MatrixManipulator{
|
||||
char **matrix; // Pointer to a 2D character array
|
||||
int numRows; // Number of rows in the array
|
||||
int numColumns; // Number of columns in the array
|
||||
string dictionary[109] = { // Array of strings containing words to be searched for
|
||||
"cat", "dog", "bat", "hat", "run", "sun", "red", "blue", "pen", "cup",
|
||||
"fish", "bird", "rose", "tree", "lake", "moon", "star", "fork", "lamp", "book",
|
||||
"play", "pool", "rose", "silk", "soft", "ship", "tile", "vest", "wish", "zoom",
|
||||
"case", "drop", "face", "gold", "jump", "kick", "lime", "nose", "ring", "tail",
|
||||
"cloud", "crawl", "dream", "fresh", "grain", "happy", "juice", "lucky", "music", "piano",
|
||||
"queen", "quick", "smile", "storm", "toast", "umbra", "video", "wrist", "zebra", "world",
|
||||
"apple", "brave", "chess", "drink", "flame", "grape", "jazz", "lemon", "novel", "pride",
|
||||
"quest", "route", "shoe", "trace", "unity", "vivid", "water", "xerox", "yellow", "zesty",
|
||||
"silver", "orange", "camera", "travel", "window", "floral", "banana", "purple", "turkey",
|
||||
"magnet", "branch", "guitar", "impact", "castle", "pickle", "forest", "oliver", "planet", "summer",
|
||||
"a", "i", "on", "up", "by", "go", "no", "eat", "it", "as"
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
MatrixManipulator(int numRows, int numColumns) : numRows(numRows), numColumns(numColumns){
|
||||
allocateMemory();
|
||||
}
|
||||
|
||||
~MatrixManipulator(){
|
||||
for(int i=0;i<numRows;i++) delete[] matrix[i];
|
||||
delete[] matrix;
|
||||
}
|
||||
|
||||
void allocateMemory(){
|
||||
matrix = new char*[numRows];
|
||||
for(int i=0;i<numRows;i++) matrix[i] = new char[numColumns];
|
||||
}
|
||||
|
||||
void initializeMatrix(){
|
||||
cout<<"Enter values:\n";
|
||||
for(int i=0;i<numRows;i++) for(int j=0;j<numColumns;j++) cin>>matrix[i][j];
|
||||
}
|
||||
|
||||
void getWordsFromRows(){
|
||||
for(int i=0;i<numRows*numColumns;i++){
|
||||
for(int j=0;j<109;j++){
|
||||
bool match = true;
|
||||
if(matrix[i/numColumns][i%numColumns] == dictionary[j][0]){
|
||||
for(int k=i+1;k-i<dictionary[j].length() && k<numRows*numColumns;k++){
|
||||
if(matrix[k/numColumns][k%numColumns] != dictionary[j][k-i]){
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(match){
|
||||
cout<<dictionary[j]<<endl;
|
||||
i += dictionary[j].length()-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
int main(){
|
||||
|
||||
MatrixManipulator m(3, 8);
|
||||
m.initializeMatrix();
|
||||
m.getWordsFromRows();
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue