- #include<iostream>
- #include<cstdlib>
- using namespace std;
- int main()
- {
- string data[5][2]={{"大雄","0980-454666"},{"技安","0911-333898"},{"宜靜","0922-999579"},{"阿福","0938-234567"},{"小叮噹","0911-864356"}};
- cout<<"姓名\t電話\n";
- cout<<"====================\n";
- for(int i=0;i<5;i++)
- {
- cout<<data[i][0];
- if(i==5)
- cout<<" ";
- else
- cout<<'\t';
- cout<<data[i][1]<<endl;
- }
- system("pause");
- return 0;
- }
複製代碼 |