#pragma region ourfunc1.cpp
//ourfunc1.cpp -- repositioning the using directive
#if 1
#include <iostream>
using namespace std; //affects all function definitions in this file
void simon(int);
int main()
{
simon(3);
cout << "Pick an integer: ";
int count;
cin >> count;
simon(count);
cout << "Done!" << endl;
return 0;
}
void simon(int n) //define the simon()function
{
using namespace std;
cout << "Simon says touch your toes " << n << " times." << endl;
}
#endif
#pragma endregion

运行效果,从这里看,C,C++差比不大,这都是基础
931

被折叠的 条评论
为什么被折叠?



