pragma solidity >=0.4.0 <0.6.0;

/** * @title Shape calculator. /contract ShapeCalculator { /* * @dev Calculates a rectangle's surface and perimeter. * @param w Width of the rectangle. * @param h Height of the rectangle. * @return s The calculated surface. * @return p The calculated perimeter. */ function rectangle(uint w, uint h) public pure returns (uint s, uint p) { s = w * h; p = 2 * (w + h); }}

Solidity Shape Calculator: Calculate Rectangle Surface and Perimeter

原文地址: https://www.cveoy.top/t/topic/RzI 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录