标题: [求助]我是新手.今天看书遇到个问题! [打印本页] 作者: 秋风扫落叶 时间: 2009-11-3 02:12 标题: [求助]我是新手.今天看书遇到个问题! 题目:编写一个程序.要求用户输入小时数和分钟数.在main()函数中,将这两个值传递给一个void 函数,后者以下面的这样的格式显示这两个值:
Enter the number of hours:10
Ebter the number of minytes:30
Time:10:30
2)
#include<iostream>
using namespace std;作者: 爱(じΩvê) 时间: 2009-11-3 02:12
对啊作者: ぱホ 时间: 2009-11-3 02:12
/*---------------------------------------------------------------------------
File name: main.cpp
Author: HJin (email: fish_sea_bird [at] yahoo [dot] com )
Created on: 9/19/2007 07:17:19
Environment: Windows XP Professional SP2 English +
Visual Studio 2005 v8.0.50727.762
*/
#include <iostream>
using namespace std;
void function(int hours, int minutes);
int main()
{
int a, b;
cout<<"Enter the number of hours:";
cin>>a;
cout<<"Enter the number of minutes:";
cin>>b;
function(a, b);