Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

29531 755021 李睿恩 #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions 755021.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#include <iostream>
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;
}
58 changes: 58 additions & 0 deletions 菱形.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include <iostream>
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";
}
}
48 changes: 48 additions & 0 deletions 身分驗證.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#include <iostream>
#include <math.h>
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!";
}
}