__LSB__'s blog

By __LSB__, history, 6 years ago, In English

My code is like this.

package main

import "fmt"

func main() {
	var n int
	fmt.Scanf("%d", &n)

	words := make([]string, n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%s", &words[i])
	}
	for i := 0; i < n; i++ {
		if len(words[i]) > 10 {
			fmt.Printf("%c%d%c\n", words[i][0], (len(words[i]) - 2), words[i][len(words[i])-1])
		} else {
			fmt.Printf("%s\n", words[i])
		}
	}
}

It has no error when executing this code on my computer, but scoring system says it is wrong answer... What would be the problem?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it