由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 一题
相关主题
c++ 程序一问bloomberg assessment的机经,c语言的(20道题)
为什么我这段简单的程序segment fault这题哪错了?
C++ online Test 又一题这个看着很白痴的问题有更好的解法吗?
C++ 一题帮看看这段code
懒得写了,想练手的就写写贴在这里吧问一道kth smallest element的题目
你们看过programming pearls (2nd edition English) or 正在看的同学们leetcode上一题,求正解
one c++ question写了一个find kth number in 2 sorted arrays的code 请大牛看
C的argc问题大家能说说(leecode) Permutation Sequence这道题后的数学思路吗?
相关话题的讨论汇总
话题: lamb话题: maryslamb话题: mary话题: little话题: had
进入JobHunting版参与讨论
1 (共1页)
I*I
发帖数: 618
1
Consider the following C++ code:
01 #include
02 #include
03
04 int main(int argc, char *argv[])
05 {
06 std::string marysLamb;
07
08 marysLamb = "Mary had a little lamb,\n",
09 "little lamb, little lamb,\n",
10 "Mary had a little lamb,\n",
11 "whose fleece was white as snow.";
12
13 std::cout << marysLamb << std::endl;
14
15 return 0;
16 }
George wanted to write a program that prints out the first part of the “
Mary Had a Little Lamb” nursery rhyme. He wrote the above program, but it
does not work as expected.
Questions:
· What is the output of George’s program?
· And why is it not working as expected?
h**********l
发帖数: 6342
2
逗号阿
要是空格多好

【在 I*I 的大作中提到】
: Consider the following C++ code:
: 01 #include
: 02 #include
: 03
: 04 int main(int argc, char *argv[])
: 05 {
: 06 std::string marysLamb;
: 07
: 08 marysLamb = "Mary had a little lamb,\n",
: 09 "little lamb, little lamb,\n",

I*I
发帖数: 618
3
你是说改成空格就行吗?
好像不行吧

【在 I*I 的大作中提到】
: Consider the following C++ code:
: 01 #include
: 02 #include
: 03
: 04 int main(int argc, char *argv[])
: 05 {
: 06 std::string marysLamb;
: 07
: 08 marysLamb = "Mary had a little lamb,\n",
: 09 "little lamb, little lamb,\n",

I*******l
发帖数: 203
4
change the code to:
marysLamb = marysLamb + "Mary had a little lamb,\n" +....
h**********l
发帖数: 6342
5
你试试看阿

【在 I*I 的大作中提到】
: 你是说改成空格就行吗?
: 好像不行吧

I*******l
发帖数: 203
6
Yes, just checked space also works. But why?
r********g
发帖数: 1351
7
行的吧

【在 I*I 的大作中提到】
: 你是说改成空格就行吗?
: 好像不行吧

h**********l
发帖数: 6342
8
now ,you learn something . :)

【在 I*******l 的大作中提到】
: Yes, just checked space also works. But why?
1 (共1页)
进入JobHunting版参与讨论
相关主题
大家能说说(leecode) Permutation Sequence这道题后的数学思路吗?懒得写了,想练手的就写写贴在这里吧
一道C语言题你们看过programming pearls (2nd edition English) or 正在看的同学们
问一个c++ 函数指针的问题one c++ question
请教一个入门级的C的指针问题C的argc问题
c++ 程序一问bloomberg assessment的机经,c语言的(20道题)
为什么我这段简单的程序segment fault这题哪错了?
C++ online Test 又一题这个看着很白痴的问题有更好的解法吗?
C++ 一题帮看看这段code
相关话题的讨论汇总
话题: lamb话题: maryslamb话题: mary话题: little话题: had