From ada1dc01a41785241404bc486713def52344830e Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 28 Jan 2017 19:42:38 +0100 Subject: Update substring.cc --- substring.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substring.cc b/substring.cc index 243024c..55aa319 100644 --- a/substring.cc +++ b/substring.cc @@ -14,7 +14,7 @@ int main() void s(int i, int k, int n, char str[]) { - if(i < n){ + if(i < n - k){ if(i < n-k) for(int j = i; j < i+k; j++) cout << str[j]; cout << "\n"; s(i+=1, k, n, str); -- cgit v1.2.3-18-g5258