3 solutions

  • 1
    @ 2026-2-23 11:25:10
    #include<bits/stdc++.h> 
    using namespace std;
    int main()
    {
    	int x,n;
    	cin>>x>>n;
    	int t=(x+n)%7;
    	if(t==0) t=7;
    	cout<<t; 
    	return 0;
    }
    
    
    
    • 0
      @ 2026-1-25 13:22:02
      #include<bits/stdc++.h>
      using namespace std;int main(){int a,b;cin>>a>>b;cout<<(a+b-1)%7+1;}
      
      • -2
        @ 2025-11-27 11:54:18

        C++ :

        #include<bits/stdc++.h> 
        using namespace std;
        int main()
        {
        	int x,n;
        	cin>>x>>n;
        	int t=(x+n)%7;
        	if(t==0) t=7;
        	cout<<t; 
        	return 0;
        }
        
        
        • 1

        Information

        ID
        16
        Time
        1000ms
        Memory
        128MiB
        Difficulty
        6
        Tags
        # Submissions
        36
        Accepted
        12
        Uploaded By