Skip to content

Instantly share code, notes, and snippets.

View hansen033's full-sized avatar

Hansen hansen033

  • Taiwan
View GitHub Profile
@hansen033
hansen033 / 傳紙條用加解密.cpp
Last active December 31, 2017 05:22
2017/12/28 課堂測驗
#include <iostream>
using namespace std;
int main()
{
int watchdogs2 = 0;
for ( ; watchdogs2 == 0 ; ){
char num[100];
for ( int t = 0 ; t < 100 ; t ++ ){
num[t] = 0;
@hansen033
hansen033 / 3三角.cpp
Created December 24, 2017 08:46
2017/12/21
#include <iostream>
using namespace std;
int main()
{
int x;
cout << "please input the num:";
cin >> x;
cout << "type 1:\n";
for ( int t = 0 ; t < x ; t ++ ){
#include <iostream>
using namespace std;
int main()
{
int sub, men;
cout << "請輸入要算{幾個學生}的成績平均:\n";
cin >> men;
cout << "請輸入要算{幾種}科目的平均(小數點後會直接捨去):\n";
cin >> sub;
@hansen033
hansen033 / 用迴圈算x個數的平均.cpp
Last active December 7, 2017 12:01
2017/11/23 幾分鐘前交的搞錯題目
#include <iostream>
using namespace std;
int main()
{
int AL, men;
cout << "請輸入要算{幾個數}的平均數:\n";
cin >> men;
int num[men];
cout << "請輸入要算的" << men << "個數的平均數的數值(小數點會不見):\n";
#include <iostream>
using namespace std;
int main()
{
int num[10], AL;
cout << "請輸入要算的10個平均數(小數點會不見):\n";
for( int t = 0,plus ; t < 10 ; t ++ ){
cin >> num[t];
}
@hansen033
hansen033 / 加法計算機.cpp
Created November 14, 2017 14:49
2017/11/09
#include <iostream>
using namespace std;
int main(){
int plus, ans;
ans = 0;
cout << "請輸入想要加起來的數(想要減的話請用負數),輸入完成後請輸入0來取得答案\n";
while (plus !=0){
cin >> plus;
ans += plus;
#include <iostream>
using namespace std;
int main(){
int limit;
cout << "please input the LIMIT:";
cin >> limit;
for (int times = 3; times < limit; times += times){
cout << times << " ";
}
@hansen033
hansen033 / 費氏數列.cpp
Created November 2, 2017 12:11
2017/11/02 上課測驗
#include <iostream>
using namespace std;
int main()
{
int first, second, max;
cout << "請輸入你要小於等於多少數值得費氏數列:\n";
cin >> max;
first = 1;
second = 1;
@hansen033
hansen033 / 判斷成績等第.cpp
Last active November 9, 2017 11:17
2017/10/26
#include <iostream>
using namespace std;
int main()
{
int score;
cout << "輸入非0~100的數來退出\n";
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a, b, c, m, n, z;
cout <<"方程式: y=a*x*x+b*x+c\n";
cout <<"請輸入方程式中的a:\n";