#include <iostream>

/*convert cpp --converts m to cm */

int mtocm(int);

int main( )
{
using namespace std;

int m;
cout<<"Enter how long about the table?";  //顯示在銀幕上
cin>>m;

int cm=mtocm(m);

cout<<m<<"m=";
cout<<cm<<"cm."<<endl;

return 0;
}

int mtocm(int x)
{
return 100*x;
}

 

 

顯示結果:
Enter how long about the table?1

1m=100cm

arrow
arrow
    全站熱搜

    布拉怡 發表在 痞客邦 留言(0) 人氣()