forked from i-am-lax/cpp-challenges
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
28 lines (25 loc) · 1.33 KB
/
Copy pathmain.cpp
File metadata and controls
28 lines (25 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "substring.h"
#include <iostream>
using namespace std;
int main() {
cout << substring_position("this", "this is a simple exercise") << endl;
cout << substring_position("is", "this is a simple exercise") << endl;
cout << substring_position("is a", "this is a simple exercise") << endl;
cout << substring_position("is an", "this is a simple exercise") << endl;
cout << substring_position("exercise", "this is a simple exercise") << endl;
cout << substring_position("simple exercise", "this is a simple") << endl;
cout << substring_position("", "this is a simple exercise") << endl;
cout << substring_position("", "") << endl;
/* Test using substring_position2 */
// cout << substring_position2("this", "this is a simple exercise") << endl;
// cout << substring_position2("is", "this is a simple exercise") << endl;
// cout << substring_position2("is a", "this is a simple exercise") << endl;
// cout << substring_position2("is an", "this is a simple exercise") <<
// endl; cout << substring_position2("exercise", "this is a simple
// exercise")
// << endl;
// cout << substring_position2("simple exercise", "this is a simple") <<
// endl; cout << substring_position2("", "this is a simple exercise") <<
// endl; cout << substring_position2("", "") << endl;
return 0;
}