zzx005 @ 2024-11-30 09:59:27
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b;
if(b>=7)
{
c=a+b;
cout<<c%7;
}
else
{
cout<<a+b;
}
return 0;
}
by NoPartyForCaoDong @ 2024-11-30 10:07:04
@zzx005 这题直接判断(a+b)%7
就行了,是0就输出7,不是0输出(a+b)%7
by Arefa @ 2024-11-30 10:16:24
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b;
c=(a+b)%7;
if(c==0)
{
cout<<7;
}
else
{
cout<<c;
}
return 0;
}
by chenhaozhe123 @ 2024-11-30 10:19:39
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b;
c=(a+b)%7;
if(c==0)
{
cout<<7;
}
else
{
cout<<c;
}
return 0;
}
@zzx005
by zzx005 @ 2024-11-30 10:20:43
@NoPartyForCaoDong 谢大佬过了!