本帖最後由 tonyh 於 2014-1-4 14:58 編輯
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- int ascii_s, ascii_e;
- cout<<"在此輸入ASCII碼範圍(0~127)"<<endl;
- cout<<"起始值: ";
- cin>>ascii_s;
- cout<<"終止值: ";
- cin>>ascii_e;
- cout<<"所得字串: "<<endl;
- for(int i=ascii_s; i<=ascii_e; i++)
- cout<<char(i);
- cout<<endl;
- system("pause");
- return 0;
- }
複製代碼 |