在 MARIE 中组装当前文件后。如果我收到错误提示,我如何确定错误指向哪一行?
此外,我正在处理一项要求我输入用户的长度和宽度并输出周长或面积的任务。到目前为止,这是我所拥有的:
组织 100
输入长度 //取输入长度
store length //将长度存储在位置length1
输出长度 //显示长度值
input width //取输入宽度
存储宽度//存储到位置宽度
输出宽度 //显示输入宽度
负载宽度
subt width One //(从 w 中减去 1 直到 0)
存储宽度
加载一个
add length // 将 l 添加到区域
存储一个
Skipcond 00d //(当宽度达到 0 时跳过)
跳转 007 //
输出区
停
一,十二月 0
b, 12 月 0 日
c, 12 月 0 日
结尾
我也是用java写的,以便更清楚地理解
//find either perimeter or area of rectangle
import java.util.Scanner;
public class PerimeterOrArea{
public static void main(String[] args){
int length, width;
int perimeter, area;
String ch;
char character;
Scanner in = new Scanner(System.in);
System.out.println("Please enter length of rectangle: ");
length = in.nextInt();
System.out.println("Please enter width of rectangle: ");
width = in.nextInt();
area = length*width;
perimeter = 2*(length + width);
System.out.println("Please enter P to find perimeter of rectangle or A to find area of rectangle");
ch = in.next();
character = ch.charAt(0);
if(character == 'P')
System.out.println("The value of perimeter is : " + perimeter);
if(character == 'A')
System.out.println("The value of area is : " + area);
}
}
MARIE 代码中仍然存在 6 个错误。请帮忙。