- Feb 20 Tue 2018 22:52
-
N factorial implemented by recursive
- Apr 23 Sun 2017 14:43
-
Union空間配置
union Float {
float f;
unsigned char buf[4];
struct {
unsigned F : 23;
unsigned E : 8;
unsigned S : 1;
}b;
}x;
float f;
unsigned char buf[4];
struct {
unsigned F : 23;
unsigned E : 8;
unsigned S : 1;
}b;
}x;
- Apr 19 Wed 2017 01:13
-
進階陣列與point觀念
https://squall.cs.ntou.edu.tw/cprog/materials/AdvancedArray.html
這是我覺得將陣列概念講解較清楚的方式,不像大部分講解都用文字
這是我覺得將陣列概念講解較清楚的方式,不像大部分講解都用文字
- Apr 06 Thu 2017 20:37
-
圈圈叉叉(與電腦對決)
#include<stdio.h>
#include<cstdlib>
void print_form(char **pf, char *sb);
int sb_check(char sb[3][3]);
char computer_think(char sb[3][3]);
char input_pos();
#include<cstdlib>
void print_form(char **pf, char *sb);
int sb_check(char sb[3][3]);
char computer_think(char sb[3][3]);
char input_pos();
- Mar 06 Mon 2017 16:01
-
學生身家調查
#include <iostream>
#include<cstring>
using namespace std;
struct student
{
long id;
char gender;
int age;
int money;
};
#include<cstring>
using namespace std;
struct student
{
long id;
char gender;
int age;
int money;
};
- Mar 06 Mon 2017 15:51
-
關於c-string的指派問題
void judge(long id, char gender, int age, int money)
{
char a[20],m[5],g[20];
if (age < 21)
a = "young"; //cstring基本上在c++中,只有在初始值的時候能給字串,其餘時候都不行
else 所以這邊的示範a,g,m都是錯的,而在這邊可以改用strcpy這個函數來給值//
a = "adult";
{
char a[20],m[5],g[20];
if (age < 21)
a = "young"; //cstring基本上在c++中,只有在初始值的時候能給字串,其餘時候都不行
else 所以這邊的示範a,g,m都是錯的,而在這邊可以改用strcpy這個函數來給值//
a = "adult";
- Mar 06 Mon 2017 11:37
-
預期收益本金計算
#include <iostream>
#include <cmath>
using namespace std;
struct money
{
int P;
int F;
double r;
int n;
};
#include <cmath>
using namespace std;
struct money
{
int P;
int F;
double r;
int n;
};
- Feb 22 Wed 2017 18:19
-
將Array由小排到大
#include <iostream>
using namespace std;
void displayarray(int[], int);
void insertionsort(int[], int);
using namespace std;
void displayarray(int[], int);
void insertionsort(int[], int);
- Feb 22 Wed 2017 17:34
-
時間轉換
#include <iostream>
using namespace std;
struct Time
{
int minutes;
int hours;
int seconds;
};
using namespace std;
struct Time
{
int minutes;
int hours;
int seconds;
};
- Feb 10 Fri 2017 17:26
-
各圖形周長
#include<iostream>
using namespace std;
const double pi=3.1415926;
double squa(double);
double rec(double,double);
double cir(double);
using namespace std;
const double pi=3.1415926;
double squa(double);
double rec(double,double);
double cir(double);
- Feb 10 Fri 2017 17:03
-
s1=1+1/2+1/3+...+1/n , s2=1+1/2!+1/3!+..1/n!
#include<iostream>
#include<cmath>
using namespace std;
double s1(double);
double s2(double);
double s(double);
#include<cmath>
using namespace std;
double s1(double);
double s2(double);
double s(double);