TOPIC

Wrong Answer (10%)

gdfnsc asked 2 years ago

Estou recebendo wrong answer (10%). O codigo eh o seguinte:

package main

import "fmt"

func main() {
    input := [10]int{}

    for i := 0; i < 10; i++ {
        fmt.Scanf("%d", &input[i])

        isLowerThanZero(&input[i])
    }

    printResult(&input)
}

func isLowerThanZero(input *int) {
    if *input <= 0 {
        *input = 1
    }
}

func printResult(input *[10]int) {
    for index, value := range *input {
        fmt.Printf("X[%d] = %d\n", index, value)
    }
}

E aqui eh a mensagem de erro do teste.

### files dont match - see output
*** 1172-a.out  2022-01-27 00:05:14.414332942 +0000
--- 1172/1172-a.sol 2014-10-14 11:47:36.171034000 +0000
***************
*** 1,10 ****
  X[0] = 48
  X[1] = 1
  X[2] = 1
! X[3] = 1
  X[4] = 1
  X[5] = 1
! X[6] = 23
! X[7] = 1
! X[8] = 1
  X[9] = 1
--- 1,10 ----
  X[0] = 48
  X[1] = 1
  X[2] = 1
! X[3] = 23

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.