4 solutions

  • 3
    @ 2025-12-2 18:03:30

    函数版本

    #include<bits/stdc++.h>
    using namespace std;
    int add(int x,int n){
        	return n+x;
    	}
    int main(){
    	int a,b;
    	cin>>a>>b; 
    	cout<<add(a,b);
        return 0;
    }
    

    正常版本

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b;
    	cin>>a>>b;
    	int c=a+b;
    	cout<<c;
    	return 0;
    }
    
    

    Information

    ID
    839
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    246
    Accepted
    127
    Uploaded By