[cpp]
int main( int argc, char **argv ) //argc用於傳遞argv中字符串的個數, argv是一個C風格字符串數組
{
if( argc != 3 )//檢查命令行參數
{
return -1;
}
cout << argv[1] << "+" << argv[2] << "=" << ( ( atof(argv[1]) ) + ( atof(argv[2]) ) ) << endl;
return 0;
}