打表找规律,发现是n%4==2就是yes,否则是no
#include<iostream>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
if (n % 4 == 2)
cout << "yes" << endl;
else
cout << "no" << endl;
}
return 0;
}
时间: 2024-11-05 13:36:43
打表找规律,发现是n%4==2就是yes,否则是no
#include<iostream>
using namespace std;
int main()
{
int n;
while (cin >> n)
{
if (n % 4 == 2)
cout << "yes" << endl;
else
cout << "no" << endl;
}
return 0;
}