Board logo

標題: [作業] 字串處理 (九) - 將ASCII碼轉換為字串 [打印本頁]

作者: 方浩葦    時間: 2024-10-5 13:44     標題: [作業] 字串處理 (九) - 將ASCII碼轉換為字串



提示: char(ASCII碼) --> 字元

本帖隱藏的內容需要回復才可以瀏覽

作者: 邱博宥    時間: 4 天前 17:44

  1. #include <bits/stdC++.h>
  2. using namespace std;
  3. int main ()
  4. {
  5.     int q1,q2;
  6.     cout<<"請輸入ASCII的範圍:"<<endl;
  7.     cout<<"起始值:";
  8.     cin>>q1;
  9.     cout<<"結尾值:";
  10.     cin>>q2;
  11.     for(int a=q1;a<=q2;a++)
  12.     {
  13.         cout<<char(a);
  14.     }

  15.     return 0;
  16. }
複製代碼





歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/) Powered by Discuz! 7.2