Upload files to "/"
This commit is contained in:
parent
167ce4fb19
commit
83bdcdabd5
52
mk_daa_rasya_alfahrizi.py
Normal file
52
mk_daa_rasya_alfahrizi.py
Normal file
@ -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 <iostream>
|
||||||
|
# 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)
|
||||||
Loading…
x
Reference in New Issue
Block a user