题解 | #开学?#
开学?
https://www.nowcoder.com/practice/9cc35bd0754f4feca18e10e57c672467
#include <stdio.h> #include <stdlib.h> int main() { int a,b; int c; scanf("%d %d",&a,&b); if((a+b)>7)//判断 { if((a+b)%7==0)//考虑被7整除的数,取余为0. { c=7; } else { c=(a+b)%7; } } else { c=a+b; } printf("%d\n",c); return 0; }