This Blog is dedicated to Sir Johnson Lin
Learn flow chart from C language , master C with the chart!

C++ 基本 輸入字串並顯示字串功能 C++ basic : Input string and Display string "Welcome coding World ! "



D:\cppCodes\HelloIO\HelloIO.c++
 1 //++++++++++++++++++++++++++
 2  //      HelloIO.cpp
 3  //++++++++++++++++++++++++++
 4  
 5  ///#include headers
 6  #include <iostream>
 7  
 8  ///USING
 9  using namespace std;
10  
11  ///mainentry
12  int main()
13  {
14      ///declare variables
15      string sMyName = "";     // txt string
16      
17      ///Prompt Input
18      cout << "Please KeyIn Your Name !  :  " ;
19      
20      ///Keyin
21      cin >> sMyName;
22      
23      ///Display Input
24      cout << "Hello " << sMyName << ".  Welcom to coding world ! " << endl;
25      
26      ///mainend
27      return 0;
28  }//end main()
29  

@ 下載程式碼 Download source code

沒有留言:

張貼留言