程序源代碼如下:
創(chuàng)新互聯(lián)公司長(zhǎng)期為成百上千家客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對(duì)不同對(duì)象提供差異化的產(chǎn)品和服務(wù);打造開(kāi)放共贏平臺(tái),與合作伙伴共同營(yíng)造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為細(xì)河企業(yè)提供專業(yè)的網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè),細(xì)河網(wǎng)站改版等技術(shù)服務(wù)。擁有10余年豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開(kāi)發(fā)。
main()
{
int i,j,k;
printf("\n");
for(i=1;i5;i++)/*以下為三重循環(huán)*/
for(j=1;j5;j++)
for (k=1;k5;k++)
{
if (i!=ki!=jj!=k) /*確保i、j、k三位互不相同*/
printf("%d,%d,%d\n",i,j,k);
}
}
main()
{
long int i;
int bonus1,bonus2,bonus4,bonus6,bonus10,bonus;
scanf("%ld",i);
bonus1=100000*0.1;bonus2=bonus1+100000*0.75;
bonus4=bonus2+200000*0.5;
bonus6=bonus4+200000*0.3;
bonus10=bonus6+400000*0.15;
if(i=100000)
bonus=i*0.1;
else if(i=200000)
bonus=bonus1+(i-100000)*0.075;
else if(i=400000)
bonus=bonus2+(i-200000)*0.05;
else if(i=600000)
bonus=bonus4+(i-400000)*0.03;
else if(i=1000000)
bonus=bonus6+(i-600000)*0.015;
else
bonus=bonus10+(i-1000000)*0.01;
printf("bonus=%d",bonus);
}
給你提供我用到的代碼:\x0d\x0a'初始化全局變量\x0d\x0aOption Explicit\x0d\x0aPublic pathini As String\x0d\x0aPublic mark As Integer '控制是否自啟動(dòng)的標(biāo)志變量(1自啟動(dòng),0不自啟動(dòng))\x0d\x0a'添加刪除自啟動(dòng)項(xiàng)目的API函數(shù)聲明\x0d\x0aPublic Const HKEY_CLASSES_ROOT = H80000000\x0d\x0aPublic Const HKEY_CURRENT_USER = H80000001\x0d\x0aPublic Const HKEY_LOCAL_MACHINE = H80000002\x0d\x0aPublic Const HKEY_USERS = H80000003\x0d\x0aPublic Const HKEY_PERFORMANCE_DATA = H80000004\x0d\x0aPublic Const HKEY_CURRENT_CONFIG = H80000005\x0d\x0aPublic Const HKEY_DYN_DATA = H80000006\x0d\x0aPublic Const REG_NONE = 0\x0d\x0aPublic Const REG_SZ = 1\x0d\x0aPublic Const REG_EXPAND_SZ = 2\x0d\x0aPublic Const REG_BINARY = 3\x0d\x0aPublic Const REG_DWORD = 4\x0d\x0aPublic Const REG_DWORD_BIG_ENDIAN = 5\x0d\x0aPublic Const REG_MULTI_SZ = 7\x0d\x0aDeclare Function RegOpenKey Lib 'advapi32.dll' Alias 'RegOpenKeyA' (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long\x0d\x0aDeclare Function RegCreateKey Lib 'advapi32.dll' Alias 'RegCreateKeyA' (ByVal hKey As Long,ByVal lpSubKey As String, phkResult As Long) As Long\x0d\x0aDeclare Function RegCloseKey Lib 'advapi32.dll' (ByVal hKey As Long) As Long\x0d\x0aDeclare Function RegSetValue Lib 'advapi32.dll' Alias 'RegSetValueA' (ByVal hKey As Long, ByVal lpSubKey As String, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long\x0d\x0aDeclare Function RegSetValueEx Lib 'advapi32.dll' Alias 'RegSetValueExA' (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long\x0d\x0aDeclare Function RegDeleteValue Lib 'advapi32.dll' Alias 'RegDeleteValueA' (ByVal hKey As Long, ByVal lpValueName As String) As Long\x0d\x0a'在注冊(cè)表中添加刪除自啟動(dòng)項(xiàng)目的模塊\x0d\x0aSub Main()\x0d\x0a' 定義hKey 為句柄變量、SubKey為注冊(cè)表RUN項(xiàng)目變量、Exe為程序名變量\x0d\x0aDim hKey As Long, SubKey As String, Exe As String\x0d\x0a'將程序設(shè)定成隨 Windows 啟動(dòng)而啟動(dòng)\x0d\x0a'取程序所在路徑,判斷是否為根目錄并分別加上程序全名并賦值給變量Exe\x0d\x0aIf Right(App.Path, 1) = '\' Then\x0d\x0aExe = App.Path App.EXEName '.exe' ' 根目錄情況\x0d\x0aElse: Exe = App.Path '\' App.EXEName '.exe' ' 非根目錄情況\x0d\x0aEnd If\x0d\x0aSubKey = 'Software\Microsoft\Windows\CurrentVersion\Run' ' 設(shè)置項(xiàng)目\x0d\x0aRegCreateKey HKEY_LOCAL_MACHINE, SubKey, hKey ' 取得句柄\x0d\x0aRegSetValueEx hKey, '時(shí)間助手', 0, REG_SZ, ByVal Exe, LenB(StrConv(Exe, vbFromUnicode)) 1 ' 寫入鍵值\x0d\x0aRegCloseKey hKey ' 關(guān)閉句柄\x0d\x0aEnd Sub\x0d\x0a自己看吧,很簡(jiǎn)單的,修改一下就可以用了.
將你自己的程序添加到注冊(cè)表的開(kāi)機(jī)啟動(dòng)項(xiàng)中 具體路徑如圖所示
啟動(dòng)程序如下所示。
1:一種就是在安裝軟體時(shí)往注冊(cè)表里添加,一種簡(jiǎn)單粗暴寫個(gè)快捷方式丟到啟動(dòng)目錄里,可以在安裝軟體時(shí)寫個(gè)腳本bat解決。
2:以在注冊(cè)表里添加啟動(dòng)項(xiàng),前提是有足夠的權(quán)限,也可以創(chuàng)建一個(gè)快捷方式放在startup目錄中,也也可以把程序注冊(cè)成windows 服務(wù), 運(yùn)行方式為auto。
3:vb中寫一個(gè)代碼讓電腦一開(kāi)機(jī)程序就運(yùn)行Private Sub Form_Load()?Set w = CreateObject("wscript.shell")w.regwrite"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" App.EXEName, App.Path "\" App.EXEName ".exe"End Sub。
vb.net是一個(gè)編程軟件,啟動(dòng)后不需要登陸,而是讓你選擇是新建還是打開(kāi),新建的是winfowm、webform還是其它類型的源代碼,所以你說(shuō)的登錄一次桌面看不太懂什么意思。