include <bits/stdc++.h>
using namespace std;
int maxx, a, b, c;
int main( )
{
cin >> a;
b=10;
c=3;
while(b!=a)
{
if (c1||c2)
{
b+=7;
}
b--;
c++;
c%=7;
maxx++;
}
cout << maxx;
}
反思: while(b<a) 做錯,正確為: while(b!=a)
using namespace std;
int maxx, a, b, c;
int main( )
{
cin >> a;
b=10;
c=3;
while(b!=a)
{
if (c1||c2)
{
b+=7;
}
b--;
c++;
c%=7;
maxx++;
}
cout << maxx;
}
反思: while(b<a) 做錯,正確為: while(b!=a)