I**********s 发帖数: 441 | 1 来自主题: JobHunting版 - 问个面试题 完整代码:
/**
* 一个Cube有6个面,每一个面有一个color,这6个面的color是可以
* 任意的,而且可以重复。输入一系列的cube,判断这些cube能否组成一个四面都是
同样
* 颜色的tower(这些cube一个接一个竖着摞,没有并排的cube)。
*/
#include
using namespace std;
// Cube class. Color of cube is given in constructor.
class cube {
public:
int sides[6]; // {top, side1, side2, side3, side4, bottom}
int colors[6];
int config;
cube() {}
void init(int color[6]) {
for (int i = 0; i < 6; ++ i) colors[i] = color[i];
config = 0;
}
// given a cube ... 阅读全帖 |
|
p******s 发帖数: 107 | 2 【 以下文字转载自 NewYork 讨论区 】
发信人: partybos (partybos), 信区: NewYork
标 题: 【供求】纽约天才班K和1st Grade入学考试全套复习题
发信站: BBS 未名空间站 (Mon May 5 17:10:38 2014, 美东)
朋友买的全套正版,他孩子用完了。有要的朋友站内信。
全套包括下面的书 -
Gifted And Talented Assessment K and 1st Grade
NNAT 2 Level A Practice Test1 K
NNAT 2 Level A Practice Test2 K
OLSAT Practice Test Level A Test1 K and 1st Grade
OLSAT Practice Test Level A Test2 K and 1st Grade
NNAT 2 Preparation
OLSAT Preparation Guide II Instruction
OLSAT Preparation Guide II (Level A)
Workbook for ... 阅读全帖 |
|
e******c 发帖数: 4 | 3 【 以下文字转载自 NewYork 讨论区 】
发信人: elitenyc (elitenyc), 信区: NewYork
标 题: 【纽约天才班】学前班和一年级考试复习题
发信站: BBS 未名空间站 (Thu Dec 11 20:13:56 2014, 美东)
帮朋友卖。原装美国著名加强班正版。请站内短信询价。先到先得。 朋友可带书在曼
哈顿见面。包括以下习题书。
Gifted And Talented Assessment K and 1st Grade
NNAT 2 Level A Practice Test1 K
NNAT 2 Level A Practice Test2 K
OLSAT Practice Test Level A Test1 K and 1st Grade
OLSAT Practice Test Level A Test2 K and 1st Grade
NNAT 2 Preparation
OLSAT Preparation Guide II Instruction
OLSAT Preparation Guide II (Level A)
Workboo... 阅读全帖 |
|
p******s 发帖数: 107 | 4 朋友买的全套正版,他孩子用完了。有要的朋友站内信。
全套包括下面的书 -
Gifted And Talented Assessment K and 1st Grade
NNAT 2 Level A Practice Test1 K
NNAT 2 Level A Practice Test2 K
OLSAT Practice Test Level A Test1 K and 1st Grade
OLSAT Practice Test Level A Test2 K and 1st Grade
NNAT 2 Preparation
OLSAT Preparation Guide II Instruction
OLSAT Preparation Guide II (Level A)
Workbook for the NNAT2 – Levels A and B
Serial Reasoning Workbook for the NNAT2 – Levels A and B
Spatial Visualization Workbook for the NNAT2 – Levels A and ... 阅读全帖 |
|
e******c 发帖数: 4 | 5 帮朋友卖。原装美国著名加强班正版。请站内短信询价。先到先得。 朋友可带书在曼
哈顿见面。包括以下习题书。
Gifted And Talented Assessment K and 1st Grade
NNAT 2 Level A Practice Test1 K
NNAT 2 Level A Practice Test2 K
OLSAT Practice Test Level A Test1 K and 1st Grade
OLSAT Practice Test Level A Test2 K and 1st Grade
NNAT 2 Preparation
OLSAT Preparation Guide II Instruction
OLSAT Preparation Guide II (Level A)
Workbook for the NNAT2 – Levels A and B
Serial Reasoning Workbook for the NNAT2 – Levels A and B
Spatial Visualization Workbook for the NNAT2... 阅读全帖 |
|
f**********w 发帖数: 210 | 6 详细名单:
舆情组 李熙蒙(渝北)(liximeng)
网评管理平台 新闻网站
陈长青(大渝网)(chenchangqing)
李元元(新华网)(liyuanyuan)
银雪(中新网)(yinxue)
张袆(人民网)(zhangyi)
区县部门联络
李成(彭水)(licheng)
陆是朝(城口)(lushicao)
张丽莉(綦江) (zhanglili)
网评组
核心网评员
李 逢春(南岸科协)(wlifengchun)
郑京鹏(忠县政协) (wzhengjingpeng)
双桥区委宣传部(sqqwxcb)
程绪鹏(市纪委)(wchengxupeng)
蔡律(中国西部香港投资 服务有限公司)(wcailv)
后街(backstreet)
薛小军(荣昌县委办... 阅读全帖 |
|
t*******y 发帖数: 21396 | 7 2.详细名单:
舆情组
李熙蒙(渝北)(liximeng)
网评管理平台
新闻网站
陈长青(大渝网)(chenchangqing)
李元元(新华网)(liyuanyuan)
银雪(中新网)(yinxue)
张袆(人民网)(zhangyi)
区县部门联络
李成(彭水)(licheng)
陆是朝(城口)(lushicao)
张丽莉(綦江)(zhanglili)
网评组
核心网评员
李逢春(南岸科协)(wlifengchun)
郑京鹏(忠县政协)(wzhengjingpeng)
双桥区委宣传部(sqqwxcb)
程绪鹏(市纪委)(wchengxupeng)
蔡律(中国西部香港投资服务有限公司)(wcailv)
后街(backstreet)
薛小军(荣昌县委办)(wxuexiaojun)
李军洋(重师学生)(wlijunyang)
李明强(彭水)(wlimingqiang)
柴世品(华龙网)(wchaishipin)
周洪军(北碚纪委)(wzhouhongjun)
陈科(彭水)(wchenke)
胡欣然(北碚环保)(whuxinran)
文天龙(彭水)(wwentianlong)
刘俐(北碚)... 阅读全帖 |
|
a****f 发帖数: 29 | 8
echo "test1 value: " . $HTTP_GET_VARS['test1']; |
|
A***l 发帖数: 461 | 9 有一幅基准的图像(Ref Image),跟两个待配准的图像(Test1,Test2)
图像都经过了二值化处理,眼睛感官上Test1更加接近Ref Image,而Test2有一些位移,
但是如果用Sum of the Square Difference去判断,Test2跟Ref的SSD反而更小一些
Variance也是Test2跟Ref更小一些。
请问有什么比较简便的方法判断出正确的图像么? |
|
A***l 发帖数: 461 | 10 【 以下文字转载自 ComputerGraphics 讨论区 】
发信人: Apell (A片), 信区: ComputerGraphics
标 题: 求教:判断两幅图像的差距除了SSD以外有别的好方法么?
发信站: BBS 未名空间站 (Mon Jul 18 03:09:41 2011, 美东)
有一幅基准的图像(Ref Image),跟两个待配准的图像(Test1,Test2)
图像都经过了二值化处理,眼睛感官上Test1更加接近Ref Image,而Test2有一些位移,
但是如果用Sum of the Square Difference去判断,Test2跟Ref的SSD反而更小一些
Variance也是Test2跟Ref更小一些。
请问有什么比较简便的方法判断出正确的图像么? |
|
T****U 发帖数: 3344 | 11 try this, which is a little less silly
delete from test1 where rowid not in (select min(rowid) from test1 group by
key1, key2, key3,...);
if
dupes
column |
|
Z****e 发帖数: 2999 | 12 the problem is indeed with they way you created the jar
change your jar to a zip file and unzip it, a normal jar as created should
look like:
com\
test1\
Class1.class
Class2.class
...
META-INF\
MANIFEST.MF
I guess yours does not look like that, because you created the jar by
specifiy the absolute path instead of relative path. you should have created
the jar in the top of your source folder and use relative path, .e.g
jar cvf test.jar com\test1\*.*
Or, since you are using e |
|
Z****e 发帖数: 2999 | 13 This is what I tried:
first, need setuid on screen:
sudo chmod +s /usr/bin/screen
sudo chmod 755 /var/run/screen
on test1 account, this is the .screenrc:
multiuser on
addacl test2
then with test2 account, do:
$ screen -S test1/[PID] -r |
|
s********e 发帖数: 1 | 14 Record one then modify the code later...
Sub test1()
'
' test1 Macro
'
'
Workbooks.Open Filename:="C:\UserStats.xls"
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.PrintOut Copies:=1
ActiveWindow.ActivateNext
End Sub |
|
d*******o 发帖数: 5897 | 15 楼主确定test1会返回正确的结果?怎么我觉得test1和test2都不可靠? |
|
d*****d 发帖数: 46 | 16 interesting, try this
void function(Ctest* test) {
delete test;
Ctest* test1 = new Ctest();
test = new Ctest();
delete test1;
}
you may see why...
that,
it |
|
c*******9 发帖数: 6411 | 17 I have the following existing structure:
in a header file header.h
struct test
{
test();
string a;
...
std::map b;
...
}
the existing code impl.cxx use this structure and work ok, now I modify
the structure as following in the header.h
struct test
{
test();
string a;
string a2;
...
std::map b;
...
}
and it crash now in impl.cxx in the existing code:
test test1;
..
test1.a2 = d; (crash here)
...
EXCEPTION_ACCES... 阅读全帖 |
|
Y*********I 发帖数: 54 | 18 各位先贤,
我试着 split file into sentences but got a error message Can't locate Text/
Sentence.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/lib .) at test1
.pl line 10. BEGIN failed--compilation aborted at test1.pl line 10.
The line 10 is use Text::Sentence qw(split_sentences);
I installed all text related packages.
多谢! |
|
c******o 发帖数: 1277 | 19 Warning: boring stuff next.太长了,不知道有人看没有。
monad不是一个数据结构,它是一个“类型“的一个“类型”的一个“类型”。(
higher order type)
举例
type:
String
first order type:
List[X], can be List[String], List[Int], List[Double]
higher order type :
Monad, Can be List[X], Try[X], Option[X]
严格来说,Monad是一个高阶的类型,一个“类型“的一个“类型”的一个“类型”
他的定义就是一个类型F,如果能在之上定义
def unit[A](a: => A): F[A]
def flatMap[A,B](ma: F[A])(f: A => F[B]): F[B]
这个类型就是一个monad.
比如List
def unit[A](a: => A): List[A]
给一个x,我能用unit做一个一个元素的List: (x)
scala> List("a")
res0: List[String]... 阅读全帖 |
|
d****n 发帖数: 1637 | 20 server code 能改动的话用这个 resteasy annotation
org.jboss.resteasy
resteasy-jaxrs
${version.resteasy}
import javax.ejb.Local;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
@Local
@GET // HTTP GET method
@Path("/Test1") // path of the service
public String test1(@QueryParam("username") String username); |
|
n*******7 发帖数: 181 | 21 osboxes@osboxes:~/proj/pc12306/Release$ ./pc12306
Total 55
start usecase1
Total time = 7.153685
start usecase2
Total time = 8.264017
diff --git a/pc12306.cpp b/pc12306.cpp
index 12ac896..c057c03 100644
--- a/pc12306.cpp
+++ b/pc12306.cpp
@@ -76,7 +76,7 @@ static void generateSearchPatterns() {
nSearches = offsets.size();
printf("Total %d\n", (int)nSearches);
for (Offsets::iterator it = offsets.begin(); it != offsets.end(); ++
it) {
- printf("%d %d %d\n... 阅读全帖 |
|
发帖数: 1 | 22 01 class Test1:
02 def __init__(self, x):
03 self.x=x
04 @property
05 def x(self):
06 return self.__x
07 @x.setter
08 def x(self, x):
09 self.__x=x
10 t=Test1(10)
11 t.__x=20
12 print(t.x)
13 print(t.__x)
14
15 class Test2:
16 def __init__(self, x):
17 self.__x=x
18 @property
19 def x(self):
20 return self.__x
21 @x.setter
22 def x(self, x):
23 self.__x=x
24 t=Test2(10)
25 t.__x=20
26... 阅读全帖 |
|
f*******l 发帖数: 8811 | 23 pdflatex test1.tex
can't find file test1.tex?
在bin目录下。
还是说miktex有其他的默认目录?
我从E:\开始都不行。 |
|
l*l 发帖数: 225 | 24 It can't be access though alias.
alias give the var at the end of your alias, so
del test1 will be translate to :/bin/mv /tmp/ test1
Obviously you will get wrong message!
Solution is using function:
del() { /bin/mv $* /tmp }
add upper line in your .bashrc
Done |
|
d*z 发帖数: 150 | 25
It seems NTFS support hard link.
I have installed MKS Toolkit so that I could use
ln to create soft/hard link in my NTFS.
But it seems it's terrible to use such kinds of link under NT.
Such as
mkdir test
ln -s test test1
cd test
vi abc
balabala
Now let's use explorer to remove the folder test1, then the file abc in test
is removed too. |
|
m**********l 发帖数: 10 | 26 I am using Microsoft Access to generate a KML file.
Here is my code:
Option Compare Database
Private Sub Command_Click()
DoCmd.OpenQuery "Test1"
'Export data to text file
Dim MyDB As Database
Dim MyRS As Recordset
Dim fld As Field
Dim strText As String
Dim MyTableName As String
Dim QryOrTblDef As String
QryOrTblDef = "Test1"
Set MyDB = CurrentDb
Set MyRS = MyDB.OpenRecordset(QryOrTblDef)
Open "I:\ConnieMa\test.kml" For Output Shared As #1
Print #1, ""
Pr |
|
h**t 发帖数: 54 | 27 【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: host (小金蛇@天天向上), 信区: Programming
标 题: LaTeX里插入图片?
发信站: The unknown SPACE (Wed May 24 21:28:18 2000) WWW-POST
如果只有*.gif或*.jpg等普通格式的图片,如何加入到
LaTeX文件中去?偶用
\begin{figure}
\includegraphics{test1.gif}
\caption{test1}
\end{figure}
不能显示出图片。据说有个eps的东西有用。
那位大侠给教一下,最好详细一点。
大家有简单的办法也请教一下。 |
|
s******r 发帖数: 1524 | 28 data test1;
input x;
datalines;
1
2
3
;
run;
data test2;
input y $1.;
datalines;
a
b
c
;
run;
proc sql;select x, y from test1 cross join test2;run;quit; |
|
s*****n 发帖数: 2174 | 29 1. lapply 是list apply在这里调用了seq函数, 那么每个调用, 其实返回的是一个
vector. 这些vector之间组成一个list, 而不是矩阵. 你可以试试这段code. list 是R
里面很灵活的一种数据结构, 习惯这种思维方式, 很好用.
add1m <- function(date){
return(seq(as.Date(date), by = "1 month", length = 12))
}
test1 <- c("2001-01-01", "2003-12-01")
lapply(test1, add1m)
2. R 里面一样可以转换. 你可以用
as.Date(25273, origin = "1970-01-01")
来把整数转换为距离基准日期相应天数的日期. 不过R很多时候过于smart, 会帮助你把
日期转换成字符, 或者整数什么的, 而你并不需要它这样做. 这就是为什么我建议你用
character. 字符串是固定的.
3. 作为一个建议, 尽量不要把变量存储为date, 或者 factor 形式的东西, 推荐用
charact |
|
j*****i 发帖数: 47 | 30 请问:SAS如何生成这三个DATA SETS: test1, test2, test3?
能给详细解释一下处理的过程吗?
谢谢。
DATA x;
INPUT x1 x2 x3 x4;
CARDS;
1 0 0 0
1 0 0 0
1 0 0 0
1 0 0 0
0 1 0 0
0 1 0 0
0 1 0 0
0 1 0 0
0 0 1 1
0 0 1 1
0 0 1 1
0 0 1 1
0 0 0 1
0 0 0 1
0 0 0 1
0 0 0 1
;
RUN;
DATA avg;
INPUT avgnum;
CARDS;
3
;
RUN;
DATA test1;
SET avg;
SET x;
RUN;
PROC PRINT;
RUN;
DATA test2;
SET avg x; |
|
A*******s 发帖数: 3942 | 31 不,我想要的结果是这样的
proc sql;
create table test1 as
select X, mean(Y) as mean
from test
group by X;
select monotonic() as Num, *
from test1;
quit;
但是我又不想产生一个间接的dataset。而且我不大明白为啥这样的结果和下面用
subquery的结果不一样。
proc sql number;
select monotonic() as Num, * from
(select X, mean(Y) as mean
from test
group by X);
quit; |
|
o****o 发帖数: 8077 | 32 if by 'merge' in your OP, you meant concatenation, then you can do similar
things like below:
data _null_;
file '/UNIX/oloolo/test1.txt';
x1=1; x2=2; x3=3; x4=4;
put x1 x2 x3 x4;
file '/UNIX/oloolo/test2.txt';
x1=11; x2=12; x3=13; x4=14;
put x1 x2 x3 x4;
run;
data new;
infile '/UNIX/oloolo/test1.txt';
input x1-x4; output;
infile '/UNIX/oloolo/test2.txt';
input x1-x4; output;
run;
use a macro to wrap all files
if it is merge then the case is a |
|
k*****u 发帖数: 1688 | 33 data test1;
input id date mmddyy10.;
cards;
01 1/2/1999
01 2/2/1999
02 3/3/1999
03 4/3/2000
;
run;
data test2;
input id date2 mmddyy10.;
cards;
01 12/2/1998
02 3/4/2000
03 3/3/1993
;
run;
data new;
merge test1 test2;
by id;
run;
data new1 (keep = id date);
set new;
where date
format date mmddyy10.;
run; |
|
R*********i 发帖数: 7643 | 34 Using the data in original stacking structure, assume variable name is var
and dataset name is test:
data test1;
set test;
by var notsorted;
retain counter;
if first.var then counter=1;
else counter=counter+1;
if last.var then output;
run;
proc sql;
select var,counter,n(counter) as numtimes
from test1
group by var,counter
order by var,counter;
quit; |
|
s*******1 发帖数: 146 | 35 data test;
input A;
cards;
1
2
3
4
5
6
7
8
9
10
;
run;
data test1;
set test;
A1=lag(A);
A2=lag2(A);
A3=lag3(A);
if A1="." then A1=0;
if A2="." then A2=0;
if A3="." then A3=0;
B=A+A1+A2+A3;
Keep A B;
run;
proc print data=test1;
run; |
|
H**********v 发帖数: 169 | 36 用SQL可以全部搞定:
proc sql;
create table test1 as select *, count(clinic_number) as count
from test
group by clinic_number;
create table test2 as select *
from test1
where count>3; |
|
d********h 发帖数: 2048 | 37 proc transpose data=test out=test1;
var feature;
by id;
data test2;
length c $ 1000;
set test1 ;
array tmp col1-col3;
do over tmp;
c=catx("_",of c tmp);
end;
proc print; |
|
t**s 发帖数: 156 | 38 如果知道有多少variable需要转换,也可以用下面的方法.
假定有100个variable
Data test1;
Set test;
Array allchar(*) _char_;
Array newvar(*) newvar1 - newvar100;
Do i=1 to dim(allchar);
newvar(i)=Input(allchar(i), best.);
End;
Run;
如果不知道, 先找出来
proc sql noprint;
select count(*) into:cnt from sashelp.vcolumn
where libname="WORK" and upcase(memname)="TEST" and upcase(type=)"CHAR";
quit;
Data test1;
Set test;
Array allchar(*) _char_;
Array newvar(*) newvar1 - newvar&cnt;
... 阅读全帖 |
|
m********l 发帖数: 791 | 39 多谢您的答复 你理解的没有错。
我不用proc sql做了一下, 也能够实现我想要的
data test;
input id var;
datalines;
1 0
1 0
1 1
2 0
2 0
3 1
3 0
;run;
proc sort data=test;
by id descending var;
run;
data test1;
set test;
by id;
if first.id = 1;
run;
data test2;
set test;
drop var;
run;
data test3;
merge test2 test1;
by id;
run;
PS:我的var变量是binary的,我用了proc sort和first.id以及merge来实现 |
|
k*******a 发帖数: 772 | 40 用两次transpose就可以了,只是变量顺序有点不同
data test;
input ID Attr1 $ Attr2 $;
datalines;
1 A1 B1
1 A2 B2
1 A3 B3
2 A4 B4
3 A5 B5
3 A6 B6
3 A7 B7
3 A8 B8
4 A9 B9
4 A10 B10
;
run;
proc transpose data=test prefix=attr1 out=test1(drop=_name_);
by ID;
var attr1;
run;
proc transpose data=test prefix=attr2 out=test2(drop=_name_);
by ID;
var attr2;
run;
data final;
merge test1 test2;
by ID;
run; |
|
r******o 发帖数: 81 | 41 其实我就是想在一个data step中创建一个macro variable: testvar,但是还需要紧接
着就可以用这个macro variable来创建一个新变量:a2。
我知道call symput创建的macro var必须先把当前data step关闭才可以调用,请问还
有别的办法可以完成我的这个编程想法吗?
谢谢大家了!!
data test1;
input a b c;
cards;
1 1 1
;
run;
data test2;
set test1;
do i = 1 to 2;
a1 = i;
call symput('testvar',a1);
%put &testvar.;
a2 = &testvar.; *ALL I want is to get a2 = 1 for the first record and 2 for
the second record in a dynamic way;
output;
end;
run |
|
i*e 发帖数: 352 | 42 awk中NF意思是记录的域的个数,换句话说就是你用分隔符划分后的column的个数
test1和test2合并之后的test3有5列
NF<5指的就是那些需要补充后续0的行
i<=2是说循环2次,因为test1有3列,test3有5列,相差2列 |
|
x**s 发帖数: 55 | 43 爆了两个料: 猛踩油门时震动大。A4 6.x加速是用应试办法作出来的,街上实战情况下
更接近7.x秒。
用T没错,那句老话there is no replacement for displacement也没错,但2.0T买3.0
~3.5的钱还是不厚道。
http://www.edmunds.com/audi/a4/2009/road-test1.html
Our skepticism centers on the engine bay, where Audi once again sends its
turbocharged four-cylinder power plant up against the six-cylinder
competition. While the revised 2.0T gets the job done at the test track, it
sounds like a Civic, and the steering wheel vibrates with four-cylinder
fervor at full throttle. We sus... 阅读全帖 |
|
w*****s 发帖数: 230 | 44 【 以下文字转载自 NextGeneration 讨论区 】
发信人: wwwjobs (minimouse), 信区: NextGeneration
标 题: 求帮助,我们这种情况怎么办?
发信站: BBS 未名空间站 (Tue May 12 17:12:39 2015, 美东)
宝宝两年前在西雅图儿童医院看病,医院ER忘了做CK/CPK, 然后转到picu,也忘了完成
没有做的lab。医生就认为他没有脂肪酸代谢病,因为如果有的话CK就会很高。没有看
到升高的CK, 还有也忘了做acylcarnitine profile, 然后就从picu第二天开始fasting
检查。
因为他的病不能挨饿,不能用普通麻醉,结果就是在以后的两天内脂肪浸润各个脏器,
导致多个脏器伤害。最后医生终于发现误诊了,他们不是纠正错误,而是选择掩盖错误
,然后找机会灭口。好在我们看到出问题后,迅速让他们换了奶粉,当时什么也不懂。
医生说啥就相信啥没有当回事。后来出院等待肝移植慢慢发现其实他应该还是代谢病。
因为没有及时纠正错误,本来可能恢复的伤害成了永久性损伤。就我们收集到的资料来
说,没有及时救治的误诊的几... 阅读全帖 |
|
s*****m 发帖数: 2024 | 45 来自主题: HouseRental版 - test1 【Location】:
ddd
【Available Duration】:
ddd
【Property type, e.g. apartment or room(s)】:
ddd
【Price】:
ddd
【Room Descriptions】:
ddd
【Contact info】:
dd |
|
s******d 发帖数: 323 | 46 ☆─────────────────────────────────────☆
starwood (star^wood) 于 (Tue Jun 26 15:56:18 2007) 提到:
规则:每个人选up to 5个基金(中国A股的不算), 写明比例,中间不可以撤换,所有
dividend, capital gain都reinvest。虚拟购买日期July 2。最后看年底的
performance。前几名有大包子!!
请大家选没有load的open end基金,方便统计。报名截至日期:7/1。
报名办法:直接reply本文。
举例1:
id: test1
VTSMX: 50%
VGTSX: 50%
remark: die hard indexing!!
举例2:
id: test2
OBCHX: 20%
MCHFX: 20%
DPCRX: 20%
FSEAX: 20%
FHKCX: 20%
remark: 老子看好中国股票
☆─────────────────────────────────────☆
neohawk (neohawk) 于 (Tue Jun 26 |
|
c*********t 发帖数: 2921 | 47 就是写出printf的输出结果。
假设这些代码运行在intel cpu, 32bit.
integer 四个bytes.
如果能在十分钟内把这些题都做对,(前提:不去看书,不在计算机上运行),肯定是
对C很熟的。
我今天面试被问到对C 的了解程度,我说 level 10,就被给了这些题,做完后回家才发
现错了很多。感觉很羞愧。
//test1
#include
int main()
{
int i=3;
int j;
j=sizeof(++i + ++i);
printf("i= %d j= %d \n", i, j);
} |
|
c****p 发帖数: 32 | 48 嗯,但是也可以从另一个方面来说不需要recompile.
如果已经explicitly 有了其他ctor,加入新的没有影响。
这个基本上是要重新compile,一个例外是加入原来的class本来就只是method的封装比
如:
class Methods
{
public:
staic void test1();
}
这样加入new member fields也没什么关系(但是如果client code有类似sizeof(
Methods)的就不行)
这个一定要重新compile.其他的例子都可以找到反例(虽然有点急转弯的意思),但是
因为dtor是一定要被用到的,如果原本的dtor变成virtual,那么client端整个调用过
程就变了。原来是:
$Class_Dtor();
变成virtual后变成了
pClass->vtbl[index_of_dtor]();
所以client端必须重新compile.
反例是如果这个member function根本就没用到:D |
|
|
d****n 发帖数: 233 | 50 // test1.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
void PrintArray(int *A, unsigned int N)
{
for (unsigned int i = 0; i < N; i++)
{
printf("%d ", A[i]);
}
printf("\r\n");
}
// This method print out an array iteratively.
// The idea behind this is:
// 1. Suppose we have a way to print out permutation for A[n-1].
// 2. For every permutation, insert the nth element between any of
// the n-1 elements will construct a new permuation
// F |
|