From 83bdcdabd59bdbec76a0a4eead9a70c640d8a6c3 Mon Sep 17 00:00:00 2001 From: 202510715125 RASYA ALFAHRIZI <202510715125@mhs.ubharajaya.ac.id> Date: Wed, 11 Mar 2026 19:11:22 +0700 Subject: [PATCH] Upload files to "/" --- mk_daa_rasya_alfahrizi.py | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 mk_daa_rasya_alfahrizi.py diff --git a/mk_daa_rasya_alfahrizi.py b/mk_daa_rasya_alfahrizi.py new file mode 100644 index 0000000..ffb1f8b --- /dev/null +++ b/mk_daa_rasya_alfahrizi.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +"""MK-DAA-Rasya-Alfahrizi.ipynb + +Automatically generated by Colab. + +Original file is located at + https://colab.research.google.com/drive/1VhjxRGwEACSu603yf4vSszy0Ii6hNzex + +**PROGRAM FIZZBUZZ 1-100** + +~ *Program FizzBuzz menggunakan c++* +""" + +# Commented out IPython magic to ensure Python compatibility. +# %%bash +# cat << 'EOF' > fizzbuzz.cpp +# #include +# using namespace std; +# +# int main() { +# for(int i = 1; i <= 100; i++) { +# if(i % 3 == 0 && i % 5 == 0) { +# cout << i << " FizzBuzz" << endl; +# } +# else if(i % 3 == 0) { +# cout << i << " Fizz" << endl; +# } +# else if(i % 5 == 0) { +# cout << i << " Buzz" << endl; +# } +# else { +# cout << i << endl; +# } +# } +# return 0; +# } +# EOF +# +# g++ fizzbuzz.cpp -o fizzbuzz +# ./fizzbuzz + +"""~ *Program FizzBuzz menggunakan Python*""" + +for i in range(1, 101): + if i % 3 == 0 and i % 5 == 0: + print(i, "FizzBuzz") + elif i % 3 == 0: + print(i, "Fizz") + elif i % 5 == 0: + print(i, "Buzz") + else: + print(i) \ No newline at end of file