diff --git a/755021.cpp b/755021.cpp new file mode 100644 index 0000000..fec8295 --- /dev/null +++ b/755021.cpp @@ -0,0 +1,44 @@ +#include +using namespace std; + +int main() { + float confirm; + int money = 0, total = 0; + + do { + + cout << "金額:"; + cin >> confirm; + money = confirm = confirm * 10 ; + + } while ( confirm - money != 0 ); + + total += money / 10000; + money = money % 10000; + + total += money / 5000; + money = money % 5000; + + total += money / 1000; + money = money % 1000; + + total += money / 500; + money = money % 500; + + total += money / 100; + money = money % 100; + + total += money / 50; + money = money % 50; + + total += money / 10; + money = money % 10; + + total += money / 5; + money = money % 5; + + total += money / 1; + money = money % 1; + + cout << total; +} diff --git "a/\350\217\261\345\275\242.cpp" "b/\350\217\261\345\275\242.cpp" new file mode 100644 index 0000000..30ebe89 --- /dev/null +++ "b/\350\217\261\345\275\242.cpp" @@ -0,0 +1,58 @@ +#include +using namespace std; + +int main() { + + int height, i, space, triangle, j, space2, triangle2, height2; + string mark; + + cout << "目前還不會高為偶數的菱形 \n"; + cout << "如果您輸入的高度為偶數... \n"; + cout << "反正輸入奇數就對了 \n"; + cout << "造成您的不便還請多多包涵,謝謝ღ \n \n"; + + do { + cout << "三角形高度: \n"; + cin >> height; + + if ( height % 2 == 0){ + cout << "請輸入奇數 \n \n"; + } + } while ( height % 2 == 0 ); + + cout << "三角形符號: \n"; + cin >> mark; + + for ( i = 1; i <= height / 2 + 1; i++ ) { + + for ( space = ( height / 2 + 1 ) - i; space > 0; space-- ) { + cout << " "; + } + + for ( triangle = 1; triangle <= 2 * i - 1; triangle++ ) { + cout << mark; + } + + cout << "\n"; + } + + if ( height % 2 ==0 ) { + height2 = height + 1; + } else { + height2 = height; + } + + + for ( j = 1; j <= ( height + 1 ) / 2; j++ ) { + + for ( space2 = 1; space2 <= j; space2++ ) { + cout << " "; + } + + for ( triangle2 = 1; triangle2 <= height2 - j * 2; triangle2++ ) { + cout << mark; + } + + cout << "\n"; + } +} diff --git "a/\350\272\253\345\210\206\351\251\227\350\255\211.cpp" "b/\350\272\253\345\210\206\351\251\227\350\255\211.cpp" new file mode 100644 index 0000000..b2565b6 --- /dev/null +++ "b/\350\272\253\345\210\206\351\251\227\350\255\211.cpp" @@ -0,0 +1,48 @@ +#include +#include +using namespace std; + +int main() { + int a, b, i, j, check, check2, max1, max2, Verification, Verification2, Verification3, checkV; + long count; + //144523050 + count = 1000000000; + max1 = max2 = 0; + + cin >> Verification; + Verification2 = Verification3 = Verification; + + for (i = 0; i < 9; i++) { + count = count / 10; + a = Verification / count; + Verification = Verification % count; + + if (a > max1) { + max1 = a; + checkV = count; + } + + } + + count = 1000000000; + Verification2 = Verification2 - max1 * checkV; + + for (j = 0; j < 9; j++) { + count = count / 10; + b = Verification2 / count; + Verification2 = Verification2 % count; + + if (b > max2) { + max2 = b; + } + } + + check = pow(max1, 2) + pow(max2, 2); + check2 = Verification3 - (Verification3 / 1000) * 1000; + + if (check == check2) { + cout << "Good Morning!"; + } else { + cout << "SPY!"; + } +}