#include #include using namespace std;

#define N 20

bool symmetry(string str) { int i; char e; sqstack *st; string prompt1 = 'please input string for judge'; cout << prompt1 << endl; getline(cin, str); initstack(st); for (i = 0; i < str.length(); i++) pushstack(st, str[i]); for (i = 0; i < str.length(); i++) { popstack(st, e); if (str[i] != e) { destroystack(st); cout << 'is not sym' << endl; return false; } } destroystack(st); cout << 'is sym' << endl; return true; }


原文地址: https://www.cveoy.top/t/topic/pKh5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录