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;
    }
    
    
    • 0
      @ 2025-7-2 14:25:44
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a,b;
          cin>>a>>b;
          cout<<a+b;
          return 0;
      }
      
      • -1
        @ 2025-11-24 19:49:43
        #include<bits/stdc++.h>
        using namespace std;
        int f(int x,int y)
        {
            return x+y;
        }
        int main()
        {
            int a,b;
            cin>>a>>b;
            cout<<f(a,b);
            return 0;
        }
        
        • -4
          @ 2025-8-13 15:49:01
          #include<bits/stdc++>
          using namespace std;
          int a,b;
          int main(){
          	cin>>a>>b;
          	cout<<fixed<<setprecision(0)<<a+b;
          //	看到这个题解的人这辈子有了! 
          	
          	
          	
          	return 0;
          }
          
          
          • 1

          Information

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