世界不断发展,各类电子设备不断变得更加迷你,代码却越写越长……java
A+B Problemios
Input:Two integer A,Bspa
Output:The ans of A+Bcode
1971年,Niklaus Wirth 发明 Pascal对象
越是早年的语言,内存与运行时间越少,代码也越简单blog
1 var a,b:longint; 2 begin 3 readln(a,b); 4 writeln(a+b) 5 end.
1983 年 C++ 在 Bjarne Stroustrup 手中诞生内存
主要特色是尽可能兼容C,且支持面向对象ci
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 int a,b; 6 cin>>a>>b; 7 cout<<a+b; 8 return 0; 9 }
1995 年 Sun Microsystems 经过改进 C++ 发明了 Javait
不难看出 Java 有不少与 C++ 类似的地方io
1 import java.util.Scanner; 2 public class Main 3 { 4 public static void main(String[] args) 5 { 6 Scanner in=new Scanner(System.in); 7 int a=in.nextInt(); 8 int b=in.nextInt(); 9 System.out.println((a+b)); 10 } 11 }
重点是代码长度从 5行→9行→11行
设想 N 年后的代码,会是多少行?
(不过 Python 成功打破了这一规律)