close
#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
全站熱搜