mam pytanie czemu jak mam program w takiej postacji:
include
using namespace std;
int main()
{
int a , ile;
cin >> ile;
for ( int i = 1 ; i <=ile ; i++ )
{
cin >> a;
if ( a == 1 || a == 0)
{
cout << "NIE" << endl;
}
else if ( a == 2 || a == 3 || a == 5 || a == 7)
{
cout << "TAK" << endl;
}
else if ( (a%2==0) || (a%3==0) || (a%5==0) || (a%7==0) )
{
cout << "NIE" << endl;
}
else
{
cout << "TAK" << endl;
}
}
return 0;
}
to wszystko gra. Natomiast dlaczego sędzia nie chce przyjąć tego kodu?? Natomiast jak mam w takiej postaci to wszystko się sypie??
include
using namespace std;
int main()
{
int a , ile;
cin >> ile;
for ( int i = 1 ; i <=ile ; i++ )
{
cin >> a;
if ( a == 2 || a == 3 || a == 5 || a == 7)
{
cout << "TAK" << endl;
}
else if ( (a/2) || (a/3) || (a/5) || (a/7) )
{
cout << "NIE" << endl;
}
else
{
cout << "TAK" << endl;
}
}
return 0;
}