C++ 第一个程序 C++ Primer PlusC
选择的结果怎样,现在还看不到,但时间会揭开一切
这算是用C++ 敲的第一个程序,从此开始高级语言之路
#include <iostream>
using namespace std;//放在外面对应全局。放在当前函数下仅限于当前函数使用
void time(int h,int m);
int main()
{
int hour,minutes;
cout << "Enter the number of hours: " << endl;
cin >>hour;
cout << "Enter the number of minutes: " << endl;
cin >> minutes;
time(hour,minutes);
}
void time(int h,int m)
{
cout <<"Time: "<<h<<":"<<m<<endl;
cin.get();
cin.get();
}
浙公网安备 33010602011771号