Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ConsoleApplication4.cpp : 定義主控台應用程式的進入點。
- //
- #include "stdafx.h"
- #include <iostream>
- #include <stdlib.h>
- using namespace std;
- int main()
- {
- int m = 0, n = 0, i = 0, k = 0, j = 0;
- while (1) {
- cout << "INPUT";
- cin >> m;
- if (m <= 10) {
- n = m * 6;
- }
- else if (m > 10 && m < 21) {
- i = m - 10;
- n = 10 * 6;
- j = i * 2;
- n += j;
- }
- else if (m > 20 && m < 40) {
- i = 0;
- k = 0;
- j = 0;
- n = 10 * 6;
- i = 20 - 10;
- j = i * 2;
- n += j;
- j = 0;
- k = m - 20;
- j = k * 1;
- n += j;
- }
- else if (m >= 40) {
- n = 100;
- }
- cout << endl << n;
- system("PAUSE");
- system("CLS");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement