From 0f5c96ab2741381e5ab3b801c6923dc1e3c1ed93 Mon Sep 17 00:00:00 2001 From: ami Nitadori Date: Tue, 11 Oct 2022 17:07:10 +0900 Subject: [PATCH 1/2] =?UTF-8?q?1=E3=81=A4=E7=9B=AE=E3=81=AE=E3=82=BF?= =?UTF-8?q?=E3=82=B9=E3=82=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FizzBuzz/FizzBuzz/ViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/FizzBuzz/FizzBuzz/ViewController.swift b/FizzBuzz/FizzBuzz/ViewController.swift index a44b706..ede78a2 100644 --- a/FizzBuzz/FizzBuzz/ViewController.swift +++ b/FizzBuzz/FizzBuzz/ViewController.swift @@ -12,6 +12,10 @@ class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. + for i in 1...100{ + print (i) + } + } From 278fbf7cc6ba87dbc6732141713339dca3a5ccd1 Mon Sep 17 00:00:00 2001 From: ami Nitadori Date: Tue, 11 Oct 2022 17:41:50 +0900 Subject: [PATCH 2/2] =?UTF-8?q?1=E3=81=A4=E7=9B=AE=E3=81=AE=E3=82=BF?= =?UTF-8?q?=E3=82=B9=E3=82=AF=E6=94=B9=E8=A8=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FizzBuzz/FizzBuzz/ViewController.swift | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/FizzBuzz/FizzBuzz/ViewController.swift b/FizzBuzz/FizzBuzz/ViewController.swift index ede78a2..11f7d9a 100644 --- a/FizzBuzz/FizzBuzz/ViewController.swift +++ b/FizzBuzz/FizzBuzz/ViewController.swift @@ -13,11 +13,18 @@ class ViewController: UIViewController { super.viewDidLoad() // Do any additional setup after loading the view. for i in 1...100{ - print (i) + if(i%3==0 && i%5==0){ + print("FizzBuzz") + }else if(i%3==0){ + print("Fizz") + }else if(i%5==0){ + print("Buzz") + }else{ + print (i) + } } } - }