- #include<iostream>
- #include<cstdlib>
- #include<string>
- using namespace std;
- int main()
- {
- int o,m;
- //char str[100];
- cout<<"請在此輸入ascii碼範圍(0~127): ";
- /*cin.getline(str,127);
- cout<<"此字串的ASCII字元碼依序為:"<<endl;*/
- cout<<"起始值"<<endl;
- cin>>o;
- cout<<"終止值"<<endl;
- cin>>m;
- for(int i=o;i<=m;i++)
- {
- cout<<char(i)<<" ";
-
- }
- system("pause");
- return 0;
- }
複製代碼 |