結果
問題 | No.207 世界のなんとか |
ユーザー |
![]() |
提出日時 | 2016-01-11 19:16:23 |
言語 | Go1.4 (1.4.2) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 701 bytes |
コンパイル時間 | 256 ms |
コンパイル使用メモリ | 33,864 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 00:35:38 |
合計ジャッジ時間 | 945 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
package mainimport ("fmt""bufio""os""strconv")func check3 (a int) bool{if a%3==0 {return true}for ;a > 0; a/= 10{if a%10==3{return true}}return false;}func main() {var a, b = nextInt(), nextInt()for i := a; i <= b; i++ {if check3(i) {fmt.Println(i)}}}var s = bufio.NewScanner(os.Stdin)func next() string {s.Split(bufio.ScanWords)s.Scan()return s.Text()}func nextLine() string {s.Split(bufio.ScanLines)s.Scan()return s.Text()}func nextInt() int {i, e := strconv.Atoi(next())if e != nil {panic(e)}return i}func nextLong() int64 {i, e := strconv.ParseInt(next(), 10, 64)if e != nil {panic(e)}return i}