027.將輸入字串轉換為對應之整數輸出。
原發表者:orka
在此感謝當年在數位高手(NBP)分享的朋友,本人將資料彙整於此並盡量將當初發表者名稱註記。
原發表者:orka
#include <iostream> #include <cstring> using namespace std; void main() { int x=0; char word[80]; cout << "Please Input word:"; cin >> word; x=strlen(word); for (int i=0;i<=x;i++) { if (word[0] >= 58 || word[0] <= 47) { cout << "0" << endl; break; } if (word[i] <=58 && word[i] >=47) cout << word[i]; } }
在此感謝當年在數位高手(NBP)分享的朋友,本人將資料彙整於此並盡量將當初發表者名稱註記。
全站熱搜
留言列表