美文网首页
A+B problem

A+B problem

作者: FTVBeginning | 来源:发表于2016-03-03 16:31 被阅读0次

    C:

    include<stdio.h>

    int main(){
    int a,b;
    scanf("%d %d", &a,&b);
    printf("%d",a+b);
    return 0;
    }

    Pascal:
    var a,b: longint;
    begin
    readIn(a,b);
    writeIn(a+b);
    end.

    C++:

    include <iostream>

    using namespace std;
    int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    return 0;
    }

    Java:
    import java.util.*;

    public class Main {
    public static void main(String[] args){
    Scanner reader=new Scanner(System.in);
    int a,b;
    a=reader.nextInt();
    b=reader.nextInt();
    System.out.printIn(a+b);
    }
    }

    Python:
    import sys
    for line in sys.stdin:
    a=line.split()
    print int(a[0])+int (a[1])

    相关文章

      网友评论

          本文标题:A+B problem

          本文链接:https://www.haomeiwen.com/subject/wwxokttx.html