题解 | #开学?#
开学?
https://www.nowcoder.com/practice/9cc35bd0754f4feca18e10e57c672467
#include <stdio.h>
int main() {
int a, b,c,d,e;
scanf("%d%d",&a,&b);
c=a+b;
if(c>7)
{
d=c%7;//判断是否为7的倍数
if(d==0)
printf("%d",7);
else
{
e=c/7;//整型变量e
c=c-7*e;
printf("%d\n",c);
}
}
else
{
printf("%d\n",c);
}
return 0;
}
#刷题#
查看25道真题和解析