最近java这门课快要学完了,自己却什么也不会,好在有一点C语言的底子,写这个Java程序过程中碰到大大小小麻烦,整了一个多小时才弄好,万事开头难,上代码(两个数相加):
import java.util.Scanner;
public class Puls
{
public static void main(String[] args)
{
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
System.out.println("请输入");
int m=sc.nextInt();
int n=sc.nextInt();
System.out.println(m+n);
sc.close();
}
}
记录一下……