2 solutions

  • 1
    @ 2026-10-11 14:08:11
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
        long long N,a,b,c;
        cin>>N;
        for(int i=1;i<=N;i++){
            cin>>a>>b>>c;
            if(a==1){
                cout<<b+c<<endl;
            }
            if(a==2){
                cout<<b-c<<endl;
            }
            if(a==3){
                cout<<b*c<<endl;
            }
            if(a==4){
                cout<<b/c;
            }
        }
    return 0;
    }
    
    • 0
      @ 2026-8-5 16:06:59
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          long long n;
      	cin>>n;
      	for(int i=1;i<=n;i++)
      	{
      		long long a,b,c;
      		cin>>a>>b>>c;
      		if(a==1)
      		{
      			cout<<b+c<<endl;
      		}
      		if(a==2)
      		{
      			cout<<b-c<<endl;
      		}
      		if(a==3)
      		{
      			cout<<b*c<<endl;
      		}
      		if(a==4)
      		{
      			cout<<b/a<<endl;
      		}
      	}
      	return 0; 
      }
      
      • 1

      Information

      ID
      3476
      Time
      1000ms
      Memory
      64MiB
      Difficulty
      1
      Tags
      # Submissions
      69
      Accepted
      26
      Uploaded By