Files
acm-code/LC2/6.go
T

28 lines
326 B
Go
Raw Normal View History

//go:build ignore
// 特定结束符:读入整数,输入 0 时结束,每行输出该数的两倍
// 输入示例:
// 1
// 2
// 3
// 0
// 输出示例:
// 2
// 4
// 6
package main
import "fmt"
func main() {
for {
var n int
// TODO: 读入 n
if n == 0 {
break
}
fmt.Println(n * 2)
}
}