摘要:
/*数字转换成字符串*/#include <iostream>#include <stdio.h>using namespace std;int main(){ int num = 12345; char str[20]; sprintf(str, "%d", num); cout << str;}/*数字转换成字符串*/#include <iostream>#include <stdio.h>using namespace std;int main(){ int num; char str[20] = " 阅读全文
摘要:
/*回文数判断*/#include <iostream>#include <string>using namespace std;int main(){ string str; cin >> str; int backward = 0; int farward = str.size() - 1; for ( ; backward <= farward; backward++, farward--) { if (str[backward] != str[farward]) { break; } } if (backward > farward) { 阅读全文