正在加载图片...
面向对象程序设计 WF 2: #include<iostream. h> void main() i int m cout < n input an integer cin>> m 堂提要 switch(m) i case 1: cout <<"one"<< endl; break 第五章C++基础 case2:cou<"tWo<<end; break;5,C十概述 case3:cout<<" three"<<endl; break:52数据和表达式 default: cout < " default"<< endl 53基本语句 54函数 55数组与指针 结果 Input an integer 2 two第五章 C++基础 5.1 C++概述 5.2 数据和表达式 5.3 基本语句 5.4 函数 5.5 数组与指针 例2:#include<iostream.h> void main( ) { int m; cout << "\n input an integer:" ; cin >> m; switch(m) { case 1: cout << "one"<< endl; break; case 2: cout << "two" << endl; break; case 3: cout << "three" << endl; break; default: cout << "default" << endl; } } input an integer: 2 two 结果
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有