Kiểm Tra Chuổi Đối Xứng

#include<iostream> using namespace std; #include<string.h> #include<conio.h> int dx(char s[100]) { int n=strlen(s); for(int i=0, j=n-1;i<n, j>=0;i++, j--) { if(s[i] !=s[j]) { return 0; } } return 1; } int main() { char a[30]; printf("nhap chuoi ky tu\n"); gets(a); ///printf("xuat chuoi"); int k=dx(a); if(k==0) { printf("ko la chuoi doi xung "); } if(k==1) { printf("la chuoi doi xung 100%"); } getch(); return 0; }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.