由买买提看人间百态

topics

全部话题 - 话题: printf
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
b***i
发帖数: 3043
1
来自主题: Programming版 - C的fscanf的问题
不就是读入直到|,然后读入|到一个char里面,然后读入一个浮点数吗
int main(){
char line[]={"GOODG|256.5"};
char name[10];
float x;
char c;
sscanf(line, "%[^|]%c%f", name, &c, &x);
printf("%s\n", name);
printf("%f", x);
return 0;
}
f******e
发帖数: 582
2
来自主题: Programming版 - one C programming question - Thanks.
I am programming using C under Linux. I have the following piece of code:
L1: printf("\nChild PID is: [%d]",getpid());
L2: sleep(5);
L3: printf("\nChild is Terminating...\n\n\n");
When I compile and run the program, the output of "Child PID is: [%d]" is
after sleep(5). But based on the program, it should be before sleep(5).
Where is wrong? Thanks a lot.
g********e
发帖数: 131
3
来自主题: Programming版 - 问个简单的c程序
#include
int main(int argc, char* argv[])
{
int i, j, *p;
i = 25;
j = 100;
p = &i;
printf("%f\n", i/(*p));
printf("%f\n", (float)i/(*p));
return 0;
}
为什么第一个输出是0.000000?不是1.000000?
w*****1
发帖数: 15
4
来自主题: Programming版 - A string replacement problem from leetcode
void my_replace(char *str, const char *pattern) {
if (str == NULL || pattern == NULL) return;
char *pSlow = str, *pFast = str;
int pLen = strlen(pattern);
while (*pFast != '\0') {
bool matched = false;
while (isMatch(pFast, pattern)) {
matched = true;
pFast += pLen;
}
if (matched)
*pSlow++ = 'X';
// tricky case to handle here:
// pFast might be pointing to '\0',
// and you don't want to increment past it
if (*pFast != '\0')
*pSlow++... 阅读全帖
h*******9
发帖数: 68
5
刚刚开始学java,这周就要交网上作业,可是有个地方怎么试都不对,请各位好心人帮
帮忙!
我写了一个getFNSN(FN,SN);, 来模块化我的代码,可是应用起来下一行出来的总是原
始值,而不是用户的输入值,试来试去不知道怎样改才好。急死人了!
Result of adding 0.00 and 0.00 is 0.00.
部分相关代码如下:
{
public static void main(String[] args) {

float FN=0;
float SN=0;
{out.printf( "Please enter two numbers to add, separated by a space: ");

getFNSN(FN,SN);
out.printf("Result of adding %5.2f and %5.2f is %5.2f.n",FN, SN, FN+ SN);
}
static void getFNSN (float fn, float sn){
d... 阅读全帖
t*****n
发帖数: 4908
6
来自主题: Programming版 - 微软VS修改bug的效率不行啊
printf。聪明的程序员用gdb,三哥用printf
T********i
发帖数: 2416
7
来自主题: Programming版 - 战为止戈,单线程 50M TPS
我说过,我还保留单线程处理订票请求的选项。
今天写了一个小程序进行测试。
假设:
路段有1000万个。也就是全国1000万个车站
当然,全国不可能有1000万个车站。但是可以按照路段/车次划分。
也就是全国几个月的车票可以放进去
每趟车不超过56635个座位,用ushort表达。
内存规划:
一共大约20M数据,全部fit进L3 cache。
假定:
还是一次请求20个路段。
初始化:
1000万路段填满,一共超过320亿张票。不知道够不够今后10年的总运量?
访问模式:
尽量避免L1和L2 cache hit。每个循环每路段逐一访问,最大可能造成L1,L2 miss。
结果:
如下程序:
循环:5000 × 10000000 / 20 = 2500000000
用时:49.86s
2500000000 / 49.86 = 50.14M TPS。
程序如下:
unsigned short data[10000000];
bool reserveTicket(unsigned short *line, int start, int len) {
unsigned short *p = l... 阅读全帖
d****i
发帖数: 4809
8
来自主题: Programming版 - 一个dot net浮点运算的问题
有意思,同样的乘法用C的话,得到的结果完全一样:
#include
int main(int argc, char **argv)
{
double outcome4 = 12.6*0.11985;
double x = 12.6;
double y = 0.11985;
double outcome5 = x * y;
printf("outcome4=%10.8fn", outcome4);
printf("outcome5=%10.8fn", outcome5);
}
>outcome4=1.51011000
>outcome5=1.51011000
难道是.net的问题?
p**o
发帖数: 3409
9
来自主题: Programming版 - linked list vs Binary tree

Below is some BST C code that I wrote in the past.
In the iterative version (O(1) space), finding the successor
of a given node is definitely not an O(1) time operation.
Recursion would trade space for time though.
/* Binary Search Tree struct */
typedef struct node {
int value;
struct node * parent;
struct node * left;
struct node * right;
} node_t;
/* Find the smallest node from a given subtree. */
node_t * min (node_t * n)
{
if (!n) return NULL;
while (n->left) n = n... 阅读全帖
p**o
发帖数: 3409
10
来自主题: Programming版 - linked list vs Binary tree

Below is some BST C code that I wrote in the past.
In the iterative version (O(1) space), finding the successor
of a given node is definitely not an O(1) time operation.
Recursion would trade space for time though.
/* Binary Search Tree struct */
typedef struct node {
int value;
struct node * parent;
struct node * left;
struct node * right;
} node_t;
/* Find the smallest node from a given subtree. */
node_t * min (node_t * n)
{
if (!n) return NULL;
while (n->left) n = n... 阅读全帖
N******n
发帖数: 3003
11
来自主题: Programming版 - 问个指针array 的简单问题

你的也一样:printf("p_str[1] = %sn", p_str[1]);
printf("p_str[1] @ %cn", *p_str[1]);
两个都是 b
我的是: std::cout< 也是一样
w***g
发帖数: 5958
12
来自主题: Programming版 - 所谓FP就是 递归+pattern matching?
我的意思是可以写C/C++代码,编译产生机器语言。有什么问题吗? 高级语言存在的目
的显然不是为了能用printf或者比printf更牛B的方法打印出汇编语言。
你已经有一个很牛B的语言了,不去用这个语言编程解决问题,而去用这个语言打印一
个更低级的语言,除了写编译器以外怎么看都是一件非常愚蠢的事情。如果用Haskell
写编译器,怎么着也得写一种比Haskell更牛的语言的编译器才值得吧。但是有那么牛B
的语言大家还学Haskell干嘛。
m*********a
发帖数: 3299
13
int isBST(binaryTree *node){
return (isBSTUtil(node,INT_MIN,INT_MAX));
}
int isBSTUtil(binaryTree *node,int min,int max){
if (node==NULL) return 1;
if (node->key>=min && node->key isBSTUtil(node->left,min,node->key)&&
isBSTUtil(node->right,node->key+1,max))
return 1;
else return 0;
}
主程序
if (isBST(root)) printf("It is a BST tree.n");
else printf("It is NOT a BST tree.");
然后就是NOT a BST.郁闷
m*********a
发帖数: 3299
14
来自主题: Programming版 - Reverse Words in a String
void reverseWords(char *s) {
struct strStack{
char str[80];
struct strStack *next;
};
struct strStack *root,*tmp;
root=NULL;
int i;
while (*s!='\0'){
while (*s==' ') s++;
if (*s=='\0') break;
if (root==NULL){
root=malloc(sizeof(struct strStack));
root->next=NULL;
}
else {
tmp=malloc(sizeof(struct strStack));
... 阅读全帖
s******y
发帖数: 613
15
【 以下文字转载自 biojailbreak 俱乐部 】
发信人: szbiophy (szbiophy), 信区: biojailbreak
标 题: 求助 怎么编辑 多个 .c files(比如a.c, b.c) 和一个.h file(ab.h)
发信站: BBS 未名空间站 (Tue Sep 9 10:43:53 2014, 美东)
求助
怎么编辑 多个 .c files(比如a.c, b.c) 和一个.h file(ab.h)
//a.c
#include
int main()
{
printf("use b to apply a.c, and the global variable define 'r' in ab.hn");
printf("this is a.c %dn",r);
return;
}
//b.c
#include
int main (int argc, char *argv[])
{
调用 a.c 五遍 // 不知道怎么用?
return;
}
//ab.h
define int h 4;
想用b.c 调用a.... 阅读全帖
s******u
发帖数: 501
16
不能出现两个main函数,所以你这个没法编译. 或者写成
----------------------------
a.c:
#include
#include "ab.h"
void foo()
{
printf();
printf();
return;
}
---------------------------
b.c:
void foo();
int main()
{
for(;;) foo();
return;
}
---------------------------
然后
$ gcc a.c b.c
s******y
发帖数: 613
17
来自主题: Programming版 - 问个 enum{}的问题 谢谢 (转载)
好用了 谢谢
再多多问下
status gamestatus; //
如果return gamestatus=WON 想把 won 打印出来 可以吗?
我试了 printf("%c\n", gamestatus); 什么都没打印
试了 printf(“% s\n",gamestatus); 结果是报错
所以 我觉得是不是 enum status {apple, orange } 只能当flag 用了 不能当字符串
用了
V*********r
发帖数: 666
18
来自主题: Programming版 - 求教python问题,在线等 (转载)

恰恰相反,Python赋值和“传参”,在Python语言层面,都是纯粹地传引用,不是传值;
在CPython实现中,其实是传(二级)指针,只不过指针的概念没有往上暴露给Python。
比如这段python代码,a-->b传参时,传给b的就是a这个符号所指示的那个对象的引用。
def modify(b):
b[1] = 9

a = [0,1]
modify(a)
print(a[1]) # output 9
Python“传参”其实就是赋值,完完全全地等效。上述代码等效于:

a = [0,1]
b = a
b[1] = 9
print(a[1]) # output 9
第一段Python代码的大致等效的C语言代码如下:
#include
void modify(void *b) {
int **c = (int **) b;
(*c)[1] = 9;
}
int main()
{
int *a = malloc(2 * sizeof(int));
a[0] = 0;
a[1] = 1;
modi... 阅读全帖
l****c
发帖数: 838
19
来自主题: Programming版 - 今天给c++震惊了
What's the output of the following code:
int CInterviewQuestion()
{
int i;
i = 0;
printf("%d %d %d %d %dn", i++, i++, i++, i++, i++);
i=0;
printf("%d %d %d %d %dn", ++i, ++i, ++i, ++i, ++i);
return 0;
}
Try it, you'll be surprised
x******a
发帖数: 6336
20
来自主题: Programming版 - C++ problem
I got thousands problems on the following piece of code "dumpfile.h" when I
compile under cygwin. it is ok under visual stduio... can anyone help?
Thanks!
#include
#include
#include //ostream_iterator
#include //cerr
#include //std::copy
template
void dump_to_file(const char* filename, const std::vector& v_d){
std::ofstream ofs(filename);
if(!ofs){
std::cerr<<"Unable to open the file to write!n";
return ;... 阅读全帖
r***e
发帖数: 2000
21
来自主题: Programming版 - C 程序 clock() timer 问题
麻烦帮忙看一下这段程序用clock()的timer有什么问题。
#include
#include
#include
#include
int main()
{
clock_t start, end;
double elapse, _elapse;
struct timeval _start, _end;
gettimeofday(&_start, 0);
start = clock();
sleep(1);
end = clock();
gettimeofday(&_end, 0);
elapse = (end - start) / (double) CLOCKS_PER_SEC;
_elapse = ((_end.tv_sec - _start.tv_sec)*1000000.0
+ (_end.tv_usec-_start.tv_usec)) / 1000000.0;
printf("start: %ld, end: %ld, clocks... 阅读全帖
m*******n
发帖数: 305
22
来自主题: Programming版 - 办公室中的黑暗森林和降维打击
最近读到陆奇从微软离职,华人高管全面被某一族裔搞掉。 血淋淋的事实教导我们:
只有团结起来,我们才有未来,一个人是上不上去的。相信我们这些海外华人比国内华
人更能领会到这一点。
感叹于像我本人这样的理工男缺乏政治素质,需要在现实中碰得头破血流才能领悟到一
点儿东西。也许对有些读者这些只是入门知识而已,不过我希望至少对一些读者有所帮
助。
”办公室就是一座黑暗森林,每个办公室人都是带枪的猎人,像幽灵般潜行于林间,轻
轻拨开挡路的树枝,竭力不让脚步发出一点儿声音,连呼吸都必须小心翼翼:他必须小
心,因为林中到处都有与他一样潜行的猎人,如果他发现了别人有你所不知道的技术/
信息/connection,能做的只有一件事:夺取技术/信息/connection据为己有。在这
片森林中,他人就是地狱,就是永恒的威胁,任何暴露的技术/信息/connection都将
很快被拿走。“
本文中为了简洁一律用他来指代他和她。
办公室黑暗森林法则:
1. 生存是办公室个体的第一需要;
2. 不同族裔的新的个体不断从学校毕业,办公室的head count 基本保持不变或因自动
化而减小。
猜疑链 =》另一个种族的... 阅读全帖
y*******g
发帖数: 6599
23
来自主题: TeX版 - 请问怎么对代码加行号
就是插入一段代码,保存缩进和换行

#include
int main()
{
printf("hello,world!");
}
在前面加入行号变成
1 #include
2 int main()
3 {
4 printf("hello,world!");
5 }
应该怎么做呢?
谢谢
M****d
发帖数: 26
24
在emacs 中, 对于for 或if 后面的行, 格式一般是这样的:
for ( ....)
{
printf(....);
.......
我怎样才能把它变成:
for ( ....)
{
printf(....);
我查了一些书, 书上说只需对c-brace-offset有所设, 一般设为负值, 以抵消
c-continued-statement-offset. 但我已在.emacs 文件中加入了如下几句:
(setq c-continued-statement-offset 4)
(setq c-brace-offset -4)
但似乎无效, 不知各位大侠有何建议
o*****e
发帖数: 23
25
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: oldbare (oldbare), 信区: Programming
标 题: Re: 如何屏蔽掉CTRL-Z(UNIX的TERMINAL) 急
发信站: The unknown SPACE (Sun Jul 9 17:32:17 2000) WWW-POST
我是这么写的, 虽然可以屏蔽掉CTRL-Z, 但也无法继续运行程序。
请各位帮忙看看, 谢了。
void
handler(int p)
{
printf("[pid:%ld] SigInt received in Main Program:\n^C
not allowed here, quit
the program normally.\n", (long) getpid());
sigset(SIGINT, handler);
printf("[pid:%ld] SigTstp received in Main Program:\n^Z
not allowed here,quit
the program normally.\n",
o*******e
发帖数: 31
26
来自主题: Unix版 - awk question
I want to use awk to realize following goal:
when the line matches some Regular Expression, parsing
the line and output.
if the line doesn't match, don't make parsing and output
the original line.
I try to use if block like this:
if ( $0 ~ /expression/ )
{ printf "total energy =" ,$NF}
else
{printf $0}
But it doesn't work.
/expression/ {print "total energy =", $NF}
can find the desired line and output as I wish, but
I lose the control of other lines.
I don't know what's wrong with my cod
p****s
发帖数: 3184
27
来自主题: Unix版 - UNIX文件系统一问

hardlinks share file data blocks
while i-nodes are maintained separately.
softlinks share nothing, a softlink is merely a pointer in the form of
a string
manual section time
look at open(2)'s manual --> man -s 2 open
look at printf(3)'s manual --> man -s 3 printf
h*******c
发帖数: 5
28
来自主题: Unix版 - error in my function "write_log"
I write a function "write_log" to log some message:
void write_log (FILE *fp_log, char *format, ...)
{
time_t tm;
va_list vl;

va_start(vl, format);
time(&tm);

printf("%s, pid:%d, ", cut_newline(ctime(&tm)),
(int)getpid());
printf(format, vl);
fprintf(fp_log, "%s, pid:%d, ",
cut_newline(ctime(&tm)), (int)getpid());
fprintf(fp_log, format, vl);
va_end(vl);
fflush(fp_log);
}
I call the function with : w
s******s
发帖数: 35
29
来自主题: Unix版 - 偶要疯了!
I guess it is the type of i is int while printf try to
acces a float type, whihc casue the access violaion.
so try to change printf("outcom=%d\n",i);
just guess.
o**a
发帖数: 86
30
来自主题: Unix版 - owner of file

#include
#include
#include
...................
struct passwd * uptr = getpwuid(uid_t uid);
struct group * gptr = getgrgid(gid_t gid);
printf("%s", uptr->pw_name );
printf("%s", gptr->gr_name);
p******s
发帖数: 938
31
来自主题: Unix版 - 求助:pthread_create的用法
使用pthread_create()出错,以下是测试用的代码:
void *ServerThread(void *arg1)
{
printf("I'm the server\n");
}

int main()
{
pthread_t serverID;
pthread_mutex_init(&lock, NULL);
printf("Now creating the thread to serve..\n");
if(pthread_create(&serverID, NULL, ServerThread, NULL)!=0)
perror("Could not create the thread\n");
pthread_join(serverID, NULL);
exit(0);
}
运行结果:
Now creating the thread to serve..
Could not create the thread
请问是为何出错?//bow
p******s
发帖数: 938
32
来自主题: Unix版 - [转载] UNIX下的strtok
【 以下文字转载自 Programming 讨论区 】
【 原文由 phageous 所发表 】
要利用strtok来进行一些string的操作,结果却是segmentation fault,
code如下:
#include
#include
void main() {
char *str;
char *line="15:wildwood.eecs.umich.edu:018032:24.79 wildwood.eecs.umich.edu:018031:21.11 wildwood.eecs.umich.edu:018044:14.83 wildwood.eecs.umich.edu:018093:4.32";
str=strtok(line, ":");
printf("First token is %s\n", str);
while( (str=strtok(NULL, ":")) !=NULL)
printf("Next token is %s \n", str
n***l
发帖数: 9
33
来自主题: Unix版 - FreeBSD: Can't kill child process!
我有下面简单的code
pid = fork();
if (pid == 0) {
printf("Child process running\n");
} else if (pid < 0) {
printf("Failed on fork()\n");
exit(0);
} else {
... ...
if (kill(pid, SIGKILL) < 0) {
perror("Failed on kill()");
}
while(1){ ... ... };
}
运行后发现kill失败了。比如Child process的PID是4726,
在命令行“ps 4726”,结果是空的。但是用“ps”可以看到
child process。在命令行用“kill -9 4726”,系统报
错:No such process。
谁知道这到底是怎么会事?Thanks.
a*****n
发帖数: 439
34
#include
main()
{
printf("Maybe.\n");
execl("/bin/echo","echo","Always.\n",NULL);
printf("display?");
}
为什么display?不会被显示?
a***g
发帖数: 3
35
GCC 和 G++ 的区别在什么地方?

以前版本的感觉两者没有什么区别,
但是最近在 LINUX 9 下面编译, 发现以下问题:

CODE 为:

__________________________________
FILENAME: t.cc
__________________________________
# include
# include
# include

int main () {

char *c;

c = new char [100];

if (!c)
printf ("Error allocation\n");

strcpy (c, "Hello World\n");

printf ("Hello! %s", c);

cout << "Hello" << c < }

__________________________________
用 G++ 编译正确
______________________________
m******g
发帖数: 91
36
来自主题: Unix版 - 奇怪的 C 问题
【 以下文字转载自 Programming 讨论区 】
【 原文由 mangmang 所发表 】
这个程序在linux/x86上用gcc编译运行没有问题;
在Solaris(UNIX)机器上编译没问题, 但一运行就bus error.
这好像是跟机器有关系, 但还没整明白. 请大侠解惑. thx.
#include
#include
void fnFoo(void *pRow);
int main()
{
char *pTableRow;
int iRowSize;
/* the row looks like: int- char10 - int - char4
*/
iRowSize = sizeof(int) * 2 + sizeof(char) * 16;
pTableRow = (char *)calloc(1, iRowSize);
fnFoo(pTableRow);
printf("->%d<-\n", *(int*)pTableRow);
printf("->%s<-\n", (char*)
c**o
发帖数: 166
37
来自主题: Unix版 - reverse the lines?
Thanks. That is a nice one.
But suppose I have a file, say tac.out, which is generated by the following
program:
#include
int main(void)
{
int i;
for(i=1;i<5;i++) printf("line %d\n",i);
printf("line 5");

return 0;
}
Can you see what would happen if you enter
tac tac.out
?
h***o
发帖数: 539
38
来自主题: Computation版 - let me ask a question again
有.....ld = 3.1415926L;
double should be enough to handle EPS=1.e-10
you can also try this.
double a, b;
a = b = 3.0;
a += 1.e-10;
if (a == b)
printf("try long double");
else
printf("double is enough");
J*****n
发帖数: 48
39
来自主题: Computation版 - imsl编译问题
已经setup了环境:
source /usr/local/vni/CTT6.0/ctt/bin/cttsetup.csh
准备编译一个简单的C程序 a.c,里边调用了imsl fortran library
里的两个子程序,程序如下
#include
#include
//copied from some website...
main()
{
extern void rnnoa_();
extern float anordf_();
long int nr=5;
float r[5], p, x;
float one=1.0;
float zero = 0.0;
rnnoa_(&nr, r);
printf ("%f \n", r[0]);
x = .3;
p = anordf_ (&x);
printf ("%f \n", p);
}
gcc -c a.c $CFLAGS 通过
gcc -o a.out a.o $
x*****u
发帖数: 3419
40
来自主题: Computation版 - C++里用Blas/Lapack的问题
This is one I had that works:
/*
to compile :
$ gcc array_lapack.c -llapack -lblas -lm
*/
#include
#include
#define size 3 /* dimension of matrix */
struct complex {double re; double im;}; /* a complex number */
main()
{
struct complex A[3][3], b[3], WORK[6], RWORK[6];
struct complex w[3], vl[1][3], vr[1][3];
double AT[2*size*size]; /* for transformed matrix */
int i, j, ok;
char jobvl, jobvr;
int n, lda, ldvl,... 阅读全帖
x*****u
发帖数: 3419
41
来自主题: Computation版 - C++里用Blas/Lapack的问题
This is one I had that works:
/*
to compile :
$ gcc array_lapack.c -llapack -lblas -lm
*/
#include
#include
#define size 3 /* dimension of matrix */
struct complex {double re; double im;}; /* a complex number */
main()
{
struct complex A[3][3], b[3], WORK[6], RWORK[6];
struct complex w[3], vl[1][3], vr[1][3];
double AT[2*size*size]; /* for transformed matrix */
int i, j, ok;
char jobvl, jobvr;
int n, lda, ldvl,... 阅读全帖
h*******9
发帖数: 68
42
刚刚开始学java,这周就要交网上作业,可是有个地方怎么试都不对,请各位好心人帮
帮忙!
我写了一个getFNSN(FN,SN);, 来模块化我的代码,可是应用起来下一行出来的总是原
始值,而不是用户的输入值,试来试去不知道怎样改才好。急死人了!
Result of adding 0.00 and 0.00 is 0.00.
部分相关代码如下:
{
public static void main(String[] args) {

float FN=0;
float SN=0;
{out.printf( "Please enter two numbers to add, separated by a space: ");

getFNSN(FN,SN);
out.printf("Result of adding %5.2f and %5.2f is %5.2f.n",FN, SN, FN+ SN);
}
static void getFNSN (float fn, float sn){
d... 阅读全帖
t******0
发帖数: 629
43
我在网上找到如下手册http://openmp.org/mp-documents/omp-hands-on-SC08.pdf
编写出如下Hello World程序,在VC2012下跑。
#include
#include
#include // system("pause")
int main()
{
omp_set_num_threads(4);
# pragma omp parallel
{
int ID=omp_get_thread_num();
printf("Hello(%d)",ID);
printf("World(%d)n",ID);
}
system("pause"); //课件里没有这句
return(0); //课件里没有这句
}
运行结果就是:
Hello(0)World(0)
Press any key to continue...
说好的1,2,3都没看见了。。。请问我是哪里编... 阅读全帖
b***n
发帖数: 13455
44
☆─────────────────────────────────────☆
ttxs2010 (ttxs2010) 于 (Thu Apr 21 21:26:20 2011, 美东) 提到:
我对他表示羡慕,说你们CS软件真是好找工作啊!
她虽然赞同,但是也表示CS不如表面上看着那么爽。
她说,的确,就业口径是挺宽的,但是那是因为工业界对码工的需求量很大。
码工成天编程,拼的是青春饭,你年龄大了,就拼不过新上来的一茬又一茬新人了,如
果说年龄大有经验的话,软件这一行不像硬件那么看重“经验”。。。
她说,码工如果三四十岁,还没爬上去做管理之类的,就毁了,裁员的时候先把老同志
给裁了。。。。。。
我就比较疑问了,难道硕士,PhD毕业(比美国小本知识强很多),难道毕业也是码工
?比如CS PhD毕业,企业会不会更重用你呢?
“爬上管理XX”,每年CS毕业生就业那么多,肯定只有少数人爬上去吧,难道10年前的
编程前辈,今天因为没有“爬上去”就失业了?
我本来想过往软件这坑里跳呢,但一想:我读完PHD也得挺大年龄了,按照她的说法,
我假如读了一个CS PhD,那不就直接作为老同志,被... 阅读全帖
d**g
发帖数: 1031
45
网上看来的, 我擦, 都不太会做.已经没法子跳槽啦.
1、请用方框图描述一个你熟悉的实用数字信号处理系统,并做简要的分析;如果没有

也可以自己设计一个简单的数字信号处理系统,并描述其功能及用途。(仕兰微面试题

目)
2、数字滤波器的分类和结构特点。(仕兰微面试题目)
3、IIR,FIR滤波器的异同。(新太硬件面题)
4、拉氏变换与Z变换公式等类似东西,随便翻翻书把如.h(n)=-a*h(n-1)+b*δ(n) a.
求h
(n)的z变换;b.问该系统是否为稳定系统;c.写出FIR数字滤波器的差分方程;(未知

5、DSP和通用处理器在结构上有什么不同,请简要画出你熟悉的一种DSP结构图。(信

dsp软件面试题)
6、说说定点DSP和浮点DSP的定义(或者说出他们的区别)(信威dsp软件面试题)
7、说说你对循环寻址和位反序寻址的理解.(信威dsp软件面试题)
8、请写出【-8,7】的二进制补码,和二进制偏置码。用Q15表示出0.5和-0.5.(信

dsp软件面试题)
9、DSP的结构(哈佛结构);(未知)
10、嵌入式处理器类型(如ARM)... 阅读全帖
B*********h
发帖数: 800
46
☆─────────────────────────────────────☆
laterbach (aa) 于 (Tue Mar 13 00:36:42 2007) 提到:
为什么下面的程序中,在子程序中指针p不是static的,返回主函数的也是正确值?
char *test(void)
{
char *p="hello";
return(p);
}
main()
{
char *s=NULL;
s=test();
printf("%s\n",s);
}
而在下面的程序中,在子程序中数组a就必须要用STATIC型,否则就出现内存被释放的问
题?
char *test(void)
{
static char a[]="hello";
return(a);
}
main()
{
char *s=NULL;
s=test();
printf("%s\n",s);
}
☆─────────────────────────────────────☆
Diadora (超级小马) 于 (Tue Mar 13 01:
s****d
发帖数: 14
47
http://www.hftradingbook.com/content/index.php?option=com_jumi&
Statistical Arbitrage(cpp文件)
内容如下:
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
void AnalyzePair(char* symbol1, char* symbol2)
{
double close1[100] = {0};
int n1 = 0, dates1[100] = {0};
double close2[100] = {0};
int n2 = 0, dates2... 阅读全帖
m*********k
发帖数: 10521
48
来自主题: _mitbbscheck版 - 2012.5.10首页文章奖励
成功奖励 20 伪币的用户:
lukas1421, rosebug, archers, lizzycf, fighter644, jessicaniu, archers,
aTwosMam, qed, lastman907, geniushanb, critic, windriver, hte, francis1985,
ericfly77, mrsdonkey, ericfly77, maotou4444, DOA, BeeBeeWu, KFN, missingBB,
moon2011, renaissance, NIYO, QiTong, hello6000, biliantian, mahjong, iq350,
wolfstar76, cherry8982, metheuse, Portfolio6, printf, Sophiscated, Neil77,
bigchipmunk, meili123, ttsmile, shifting, qiushuiyiren, sunnystate,
yadanbenben, wolfstar76
奖励版面:(ebiz)20伪币成功
奖... 阅读全帖
w***n
发帖数: 1084
49
int tag[786];
int total_count=1000000;
int count=0;
for(int l=0; l {
memset(tag, 0, sizeof(int)*786);
for(int i=0; i<203; i++)
{
int id=RandomFloat()*786;
if(tag[id]==1) i--;
else tag[id]=1;
}
for(int i=0; i<786-5; i++)
{
if(tag[i]==1 && tag[i+1]==1 && tag[i+2]==1 && tag[i+3]==1 && tag[i+4
]==1)
{
count++;
break;
}
}
}
printf("probability: %f\n", (float)(count)/total_co
w***u
发帖数: 17713
50
你们这些会printf的码农,倒试管的科学家,好日子没了,别以为你们那点狗屁高科技
会让你们养家糊口。
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)