1 solutions

  • 0
    @ 2025-11-5 15:57:11

    C :

    #include<stdio.h>
    int main()
    {int a, b;
    while(scanf("%d%d",&a,&b)!=EOF)
    printf("%d\n",a+b);
    return 0;
    }
    

    C++ :

    
    #include<iostream>
    using namespace std;
    int pl(int &a,int &b)
    {
    	int s=0;
    	s=a+b;
    	return s;
    }
    int main()
    {
    	int a,b,m,n;
    	cin>>a>>b;
    	cin>>m>>n;
    	pl(a,b);
    	pl(m,n);
    	cout<<pl(a,b);
    	cout<<endl;
    	cout<<pl(m,n);
    }
    
    

    Pascal :

    var a,b:longint;
    begin
      while not eof do
          begin
             readln(a,b);
            writeln(a+b);
          end;
     end.
    

    Java :

    import java.util.*;
    public class Main{
    	public static void main(String args[]){
    		Scanner cin = new Scanner(System.in);
    		int a, b;
    		while (cin.hasNext()){
    			a = cin.nextInt(); b = cin.nextInt();
    			System.out.println(a + b);
    		}
    	}
    }
    
    • 1

    Information

    ID
    17368
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By