for(int i=0; i<n; i++) outfile<<arr[i]<<' ';
outfile.close();
}
int main()
{
int a[5]={0}, choice=0;
cout<<"請輸入五個值:"<<endl;
get5values(5, a);
cout<<"請選擇項目:(1)取最大值、(2)取最小值、(3)存檔"<<endl;
do{
cin>>choice;
}while(choice<1 || choice>3);
switch(choice)
{
case 1:
cout<<"最大值為"<<find_max(5, a)<<endl;
break;
case 2:
cout<<"最小值為"<<find_min(5, a)<<endl;
break;
case 3:
save(5, a);
cout<<"存檔完畢,輸入已存入output.txt"<<endl;
break;
}
cin>>choice; // (4)
return 0;
}
jethro0119 發表在 痞客邦 留言(0) 人氣(20)
#include
#include
using namespace std;
void get5values(int n, int arr[]) // (1)
{
for(int i=0; i>arr[i];
}
int find_max(int n, int arr[])
{
int max=arr[0];
for(int i=1; i
{
if(arr[i]>max) max=arr[i]; // (2)
}
return max;
}
int find_min(int n, int arr[])
{
int min=arr[0];
for(int i=0; i
{
if(arr[i]
}
return min;
}
void save(int n, int arr[])
{
ofstream outfile; // (3)
outfile.open("output.txt");
jethro0119 發表在 痞客邦 留言(0) 人氣(12)
這些是員工輪休的初版 提供給大家做變化
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If DropDownList1.SelectedItem.Text = "新增" Then
ListBox1.Items.Add(New ListItem("編號" & TextBox1.Text & " " & "姓名" & TextBox2.Text))
End If
If DropDownList1.SelectedItem.Text = "修改" Then
ListBox1.SelectedItem.Text = ("編號" & TextBox1.Text & " " & "姓名" & TextBox2.Text)
End If
If DropDownList1.SelectedItem.Text = "刪除" Then
ListBox1.Items.Remove(ListBox1.SelectedItem)
End If
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
For i As Integer = 0 To Calendar1.SelectedDates.Count - 1
ListBox2.Items.Add(New ListItem(ListBox1.SelectedItem.Text & "於" & Calendar1.SelectedDates(i) & "休假 "))
Next
End Sub
End Class
jethro0119 發表在 痞客邦 留言(0) 人氣(154)
這幾天在知識家上看著別人發問的問題
突然看到一個不錯的分享
可以讓電腦掛點的朋友不用馬上就從灌了
不然每次只要遇到電腦掛了就重灌,既勞心又傷財,唉!
大家要仔細注意這個小秘訣唷!
當您的電腦死當開不了機時,可以拿出來按步驟作。
利用登錄檔讓Windows 起死回生呀 ....
有時候會因為某些不明原因造成無法進入Windows系統中,甚至連安全模式都沒辦法起
動
若你的硬碟資料都還在的話,那可以利用scanreg這個登錄檔程式,
讓你的系統恢復至幾天前的模樣......
*作方式如下:
1當開機進入Windows之前,按 [F8]
2選擇 [5. Cmmand prompt only] 項
3出現 C:\\> 後,輸入 scanreg /restore
4選擇一個日期檔,注意日期盡量是電腦未死當機前的日期,
輕輕地按下ENTER.....就可恢愎原貌
jethro0119 發表在 痞客邦 留言(0) 人氣(126)
Partial Class _Default Inherits System.Web.UI.Page Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
jethro0119 發表在 痞客邦 留言(0) 人氣(150)
轉眼間已經是秋天了,商風吹來了蕭瑟,把心情給染成悲傷的顏色 前幾天,在MSN上看到一個令我感觸很深的狀態 -"景物依舊,人事全非" 回想起小時候的夢想,總是要做自己覺得最偉大的工作 隨著時間的流逝與社會給予的壓力,
jethro0119 發表在 痞客邦 留言(0) 人氣(241)
這次的程式有加上註解 讓不會的人比較容易懂 程式還有有些地方有小bug 請見諒 Partial Class _Default Inherits System.Web.UI.Page
jethro0119 發表在 痞客邦 留言(0) 人氣(390)
clear
p0=0.78;
p1=0.7;
Tol=10^(-10);
N0=10;
stop=0;
i=2;
g0=cos(p0)-p0;
g1=cos(p1)-p1;
while(i<N0 & stop==0)
temp=g1*(p1-p0)/(g1-g0);
p=p1-temp;
tempabs(i,1:3)=[i p abs(p-p1)];
if abs(p-p1)<Tol
stop=1
p
end
i=i+1;
p0=p1;
g0=g1;
p1=p;
g1=cos(p)-p;
end
jethro0119 發表在 痞客邦 留言(0) 人氣(220)
clear
p0=5.5;
Tol=10^(-10);
N0=10;
stop=0;
jethro0119 發表在 痞客邦 留言(0) 人氣(44)
temp1=cos(p0)-p0;
temp2=-sin(p0)-1;
p=p0-temp1/temp2;
jethro0119 發表在 痞客邦 留言(0) 人氣(45)