-
成績顯示三個部份abc
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
float gread
printf("請輸入分數\n")
scanf("%f",&gread)
if(gread>=80&&gread<=100)
printf("成績為A\n")
else if(gread>=60&&gread<=79)
{
printf("成績為B\n")
}
else if(gread>=0&&gread<60)
{
printf("成績為C\n")
}
else
{
printf("分數輸入錯誤\n")
}
system("pause")
return 0
}
標簽:
include
stdlib
float
gread
上傳時間:
2014-01-15
上傳用戶:waizhang
-
河內塔問題
#include<stdio.h>
#include<stdlib.h>
int fun_a(int)
void fun_b(int,int,int,int)
int main(void)
{
int n
int option
printf("題目二:河內塔問題\n")
printf("請輸入要搬移的圓盤數目\n")
scanf("%d",&n)
printf("最少搬移的次數為%d次\n",fun_a(n))
printf("是否顯示移動過程? 是請輸入1,否則輸入0\n")
scanf("%d",&option)
if(option==1)
{
fun_b(n,1,2,3)
}
system("pause")
return 0
}
int fun_a(int n)
{
int sum1=2,sum2=0,i
for(i=n i>1 i--)
{
sum1=sum1*2
}
sum2=sum1-1
return sum2
}
void fun_b(int n,int left,int mid,int right)
{
if(n==1)
printf("把第%d個盤子從第%d座塔移動到第%d座塔\n",n,left,right)
else
{
fun_b(n-1,left,right,mid)
printf("把第%d個盤子從第%d座塔移動到第%d座塔\n",n,left,right)
fun_b(n-1,mid,left,right)
}
}
標簽:
int
include
stdlib
fun_a
上傳時間:
2016-12-08
上傳用戶:努力努力再努力
-
指定一個數字轉換回十進位,八進位,十六進位#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int number =89
printf("數字 %d\n",number) /* %d 為十進位輸出格式*/
printf("八進位為 %o\n",number) /* %o 為八進位輸出格式*/
printf("十六進位為%x\n",number) /* %x 為十六進位輸出格式*/
system("pause")
return 0
}
標簽:
include
int
stdlib
stdio
上傳時間:
2013-11-29
上傳用戶:tyler
-
#include<stdio.h>
#include<string.h>
#include<limits.h>
#include<unistd.h>
#include<sys/types.h>
#define PROMPT_STRING "[myshell]$"
#define QUIT_STRING "exit\n"
static char inbuf[MAX_CANON]
char * g_ptr
char * g_lim
extern void yylex()
int main (void){
for( ){
if(fputs(PROMPT_STRING,stdout)==EOF)
continue
if(fgets(inbuf,MAX_CANON,stdin)==NULL)
continue
if(strcmp(inbuf,QUIT_STRING)==0)
break
g_ptr = inbuf
g_lim = inbuf + strlen(inbuf)
yylex()
}
return 0
}
標簽:
include
gt
lt
limits
上傳時間:
2016-12-31
上傳用戶:colinal
-
//順序表的建立、查找、插入與刪除
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#define ListSize 100 //表最大長度
//結構定義
typedef struct SeqList
{
int node[ListSize] //存放表結點
int length //當前表長度
} SeqList
//插入元素
insertList(SeqList *list, int e)
{
int i=list->length-1 //先將i指定為最后一項
if(i>=ListSize-1) //表已經達到最大長度ListSize
{
printf("表已滿,不能增加新的項!\n")
標簽:
include
gt
lt
malloc
上傳時間:
2014-01-17
上傳用戶:dongqiangqiang
-
s document describe davicom ic dm9000 DM9000_h.h . this ic can be used in the embedded systems and network lan cards. its is 10/100Mpbs ic.
標簽:
9000
document
describe
embedded
上傳時間:
2013-12-10
上傳用戶:xyipie
-
//初始化
initscr()
//獲得屏幕尺寸
getmaxyx(stdscr, h, w)
//畫背景
for(i=0 i<h i++)
for(j=0 j<w j++){
mvaddch(i, j, ACS_CKBOARD)
}
refresh()
//建立窗口
pad = newpad(80, 128)
for(i=0 i<80 i++){
char line[128]
sprintf(line, "This line in pad is numbered d\n", i)
mvwprintw(pad, i, 0, line)
}
//刷新屏幕
refresh()
prefresh(pad, 0, 1, 5, 10, 20, 45)
for(i=0 i<50 i++){
prefresh(pad, i+1, 1, 5, 10, 20, 45)
usleep(30000)
}
//等待按鍵
getch()
標簽:
getmaxyx
initscr
stdscr
for
上傳時間:
2014-08-30
上傳用戶:龍飛艇
-
跨數據庫平臺:
n 支持 oracle 的OCI
n 支持DB2的CLI,
n 支持ODBC(通過ODBC,可支持SQL SERVER,MySQL等)
Ø 跨OS平臺:
n 標準C++語言,支持 unix/linux/windows
Ø 使用簡單:
n 只有一個頭文件
n 接口簡潔.otl_stream, otl_connect, otl_exception等就可以完成大部分工作
n 相對 ProC等嵌入式開發,代碼能相應減少
Ø 性能:
n 直接訪問數據庫API接口,具有API接口的高效率,可靠性
Ø 穩定性:
n 開源代碼,唯一的代碼文件otlv4.h,可以了解所有基于數據庫API的實現細節
n 從1996年開始,到今已10余年.
Ø 可讀性及可維護性:
n 標準C++代碼,不需要任何預處理
n 使用流的形式,輸入輸出異常簡潔
n 減少大量代碼,
n 代碼結構更加簡潔
參考資料:
http://otl.sourceforge.net/
標簽:
ODBC
oracle
SERVE
OCI
上傳時間:
2017-06-14
上傳用戶:cainaifa
-
BP神經網絡程序,C語言源代碼
如下:
#include "iostream.h"
#include "iomanip.h"
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
#include "time.h"
#include "fstream.h"
#define N 120 //學習樣本個數
#define IN 3 //輸入層神經元數目
#define HN 2 //隱層神經元數目
#define ON 2 //輸出層神經元數目
#define Z 20000 //舊權值保存-》每次study的權值都保存下來
double P[IN] //單個樣本輸入數據
double T[ON] //單個樣本教師數據
double U11[IN][HN] //輸入層至第一隱層權值
double V[HN][ON] //隱層至輸出層權值
double X1[HN] //第一隱層的輸入
double Y[ON] //輸出層的輸入
double H1[HN] //第一隱層的輸出
double O[ON] //輸出層的輸出
double YU_HN1[HN] //第一隱層的閾值
double YU_ON[ON] //輸出層的閾值
double err_m[N] //第m個樣本的總誤差
double a //學習效率
double alpha //動量因子
標簽:
include
iostream
iomanip
stdlib
上傳時間:
2017-06-15
上傳用戶:xinzhch
-
LDPC 譯碼器
function [vhat]=decode_ldpc(rx_waveform,No,amp,h,scale)
[vhat]=decode_ldpc(rx_waveform,No,amp,h,scale)
標簽:
decode_ldpc
rx_waveform
vhat
function
上傳時間:
2014-01-13
上傳用戶:fxf126@126.com