From f94c453302bcfbaafee2af962bec6bdf09770868 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 28 Jan 2017 19:13:36 +0100 Subject: Rename ConsoleApplication1.cpp to palindromo.cc --- ConsoleApplication1.cpp | 25 ------------------------- palindromo.cc | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 ConsoleApplication1.cpp create mode 100644 palindromo.cc diff --git a/ConsoleApplication1.cpp b/ConsoleApplication1.cpp deleted file mode 100644 index 1cb19a2..0000000 --- a/ConsoleApplication1.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// ConsoleApplication1.cpp : definisce il punto di ingresso dell'applicazione console. -// -#include "stdafx.h" -#include - -using namespace std; - -bool palindromo(int i, int j, char str[]) -{ - if (i >= j) return true; - else if (str[i] == str[j]) return palindromo(i + 1, j - 1, str); - else return false; -} - -int main() -{ - char parola[] = "onorarono"; - - cout << ( (palindromo(0, sizeof parola - 2, parola) == 1) ? "E' palindromo" : "Non e' palindromo" ) << endl; - - cin.get(); - - return 0; -} - diff --git a/palindromo.cc b/palindromo.cc new file mode 100644 index 0000000..1cb19a2 --- /dev/null +++ b/palindromo.cc @@ -0,0 +1,25 @@ +// ConsoleApplication1.cpp : definisce il punto di ingresso dell'applicazione console. +// +#include "stdafx.h" +#include + +using namespace std; + +bool palindromo(int i, int j, char str[]) +{ + if (i >= j) return true; + else if (str[i] == str[j]) return palindromo(i + 1, j - 1, str); + else return false; +} + +int main() +{ + char parola[] = "onorarono"; + + cout << ( (palindromo(0, sizeof parola - 2, parola) == 1) ? "E' palindromo" : "Non e' palindromo" ) << endl; + + cin.get(); + + return 0; +} + -- cgit v1.2.3-18-g5258