Delete palindrom.cpp
This commit is contained in:
parent
82d0cd0f3d
commit
107835fc69
@ -1,36 +0,0 @@
|
||||
//palindromy
|
||||
#include <iostream>
|
||||
#include <conio.h>
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
int i,j,n;
|
||||
string a,b;
|
||||
cout<<"Podaj tekst: ";
|
||||
getline(cin,a);
|
||||
n = a.length();
|
||||
|
||||
cout<<endl;
|
||||
cout<<"n = "<<n<<endl;
|
||||
cout<<a<<endl;
|
||||
|
||||
j=0;
|
||||
for(i=n-1;i>=0;i--) {
|
||||
b[j]=a[i];
|
||||
j++;
|
||||
}
|
||||
for(i=0;i<n;i++)
|
||||
cout<<b[i];
|
||||
|
||||
int k=0;
|
||||
for(i=0;i<n;i++)
|
||||
if(a[i]!=b[i]) k=1;
|
||||
|
||||
if(k==0) cout<<"\n\t palindrom";
|
||||
else cout<<"\n\t nie palindrom";
|
||||
|
||||
getch();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user