#include <iostream>
#include <cmath>
using namespace std;
int main() {
int M;
int D;
int S ;
for (size_t i = 0; i < 2; i++)
{
cin >> M;
cin >> D;
S = (M * 2 + D) % 3;
if (S == 0)
cout << "普通" << endl;
else if (S == 1)
cout << "吉" << endl;
else
cout << "大吉" << endl;
}
system("pause");
return 0;
}
請問這樣為什麼跑測試為AC但送出答案卻是N/A?
是語法有問題還是基礎錯誤?
請各位大神給個解惑
還有遇上一次輸入兩組數字要如何處理,請一便告訴我,感謝
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int M;
int D;
int S ;
while(cin>>M>>D)
{
S = (M * 2 + D) % 3;
if (S == 0)
cout << "普通" << endl;
else if (S == 1)
cout << "吉" << endl;
else
cout << "大吉" << endl;
}
return 0;
}
#include
#include
using namespace std;
int main() {
int M;
int D;
int S ;
while(cin>>M>>D)
{
S = (M * 2 + D) % 3;
if (S == 0)
cout << "普通" << endl;
else if (S == 1)
cout << "吉" << endl;
else
cout << "大吉" << endl;
}
return 0;
}