返回列表 發帖
本帖最後由 林鼎傑 於 2021-7-3 19:40 編輯
  1. #include<iostream>
  2. #include<cstdlib>
  3. #include<cstring>
  4. using namespace std;
  5. int main()
  6. {
  7.         int a,b;
  8.         cout<<"在此輸入ASCII碼範圍(0~127): "<<endl;
  9.         cout<<"起始值: ";
  10.         cin>>a;
  11.         cout<<"終止值: ";
  12.         cin>>b;
  13.         cout<<"所得字串:"<<endl;
  14.         for(int i=a; i<=b; i++)
  15.             cout<<char(i);
  16.         cout<<endl;
  17.         system("pause");
  18.         return 0;
  19. }
複製代碼

TOP

返回列表