Arrays task
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
pawn Код:
new array[] = {7, 2, 5, 1, 3, 8, 6, 3, 4, 6}, count, temp;
for(new i = 0; i < sizeof(array); i ++)
{
    if(array[i] % 2)
    {
        temp = array[count];
        array[count ++] = array[i];
        array[i] = temp;
    }
}

for(new i = 0; i < sizeof(array); i ++)
{
    printf("%d", array[i]);
}
7 (odd)
5 (odd)
1 (odd)
3 (odd)
3 (odd)
8
6
2
4
6

What's the task for, if I may ask?
I want to be a scripter in a server I like to play in, and it's some sort of a test that the programmer gave me to be an assistant scripter.
Thanks for the help.
Reply


Messages In This Thread
Arrays task - by NeXoR - 29.09.2016, 20:02
Re: Arrays task - by SickAttack - 29.09.2016, 20:18
Re: Arrays task - by NeXoR - 29.09.2016, 20:29
Re: Arrays task - by NeXoR - 29.09.2016, 20:31
Re: Arrays task - by SickAttack - 29.09.2016, 20:58
Re: Arrays task - by NeXoR - 30.09.2016, 04:56

Forum Jump:


Users browsing this thread: 2 Guest(s)