返回列表 發帖
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<string>
  4. using namespace std;
  5. int main()
  6. {
  7.     char str[100];
  8.     cout<<"請輸入任意字串(100字內): ";
  9.     cin.getline(str,100);
  10.      cout<<"此字串的ASCII字元碼依序為:"<<endl;
  11.     for(int i=0;str[i]!=NULL;i++)
  12.     {
  13.     cout<<str[i]<<"->"<<int(str[i])<<endl;
  14.     }
  15. system("pause");     
  16. return 0;   
  17. }
複製代碼

TOP

返回列表