Mam problem, gdyż mój kod nie przechodzi przez judge’a, a działa poprawnie.
#include <iostream>
using namespace std;
int main()
{
unsigned int liczba,test,helper=0;
int *tab=new int;
cin >>test;
if(test<100000)
{
for(int i=0;i<test;i++){ cin >> tab[i]; if(tab[i]>10000 || tab[i]<=0) return 0;}
for(int j=0;j<test;j++) {
for(int i=1;i<11;i++){
if(tab[j]%i==0 ){helper++;}
}
if(helper==1 &&tab[j]>1) cout << "TAK"<<endl;
else cout << "NIE"<<endl;
helper=0;
}
}
return 0;
}
created
last reply
- 4
replies
- 814
views
- 4
users
- 2
links