1. 难过(我不想失去这个朋友 I don't want to lose this friend)

原文链接:http://talk.oralpractice.com/article_11912.html

- Hello, Mary. What’s the matter with you? You look upset.

- My friend and I was argued with each other. For this, I’m very sad. Because I don’t want to lose this friend.

- Oh, I’m sorry to hear that. I know how you feel. Please don’t be sad. 

- Thank you, but I really want to relax myself. I’m very sorry.

- OK. Don’t let it get to you. 

你好,玛丽。你怎么了?你看起来好焦虑。

我和我最好的朋友彼此发生了争吵。为了这个我很悲伤,因为我不想失去这个朋友。

噢,我很抱歉听到那个消息。我理解你的心情。请不要伤心了。

谢谢你,但是我真的想自己放松一下。我很抱歉。

好的,别为此难过。

展开阅读全文

Why!!!!!!!!!!I don't think it can run!

11-10

我在编程时遇到一个非常费解的问题。rn我认为基类指针(b++)->i会出现如(b+i)->i的东东,竟然是很规矩的0rn以为base还自己留了个的数据块。结果运行derives[i].Base::i。发现没有。rn现在我非常想知道(b++)->i的0是怎么来的。大虾救命呀。我刚从java过来。不懂呀!rn#include rnusing namespace std;rnrnclass Basernpublic: int i;rn;rnclass Derived:public Basernpublic :int n;rn Base b[10];rn rnrn;rnint main()rnrn Derived derives[5];rn Derived *derive;rn derive=derives;rn for(int i=0;i<5;i++)rn rn derives[i].i=i;rn rn Base *b;rn b=derives;rn //b++;rn// b++;rn cout<<"\n*b:(b++)->i:";rn for(int i=0;i<5;i++)rn rn cout<<" "<<(b++)->i;rn rn cout<<"\n derives[i] : \n";rn rn for(int i=0;i<5;i++)rn rn cout<<" "<i\n";rn for(int i=0;i<5;i++)rn rn cout<<" "<<(b+i)->i;rn rn cout<<"\n output derived : (derive+i)->i\n";rn for(int i=0;i<5;i++)rn rn cout<<" "<<(derive+i)->i;rn rn cout<<"\n output derived : (derive++)->i\n";rn for(int i=0;i<5;i++)rn rn cout<<" "<<(derive++)->i;rn rn rn cout<<"\n Some doubt, Why b++->i output is 0?Then the derives[i].base::i?:\n";rn for(int i=0;i<5;i++)rn rn cout<<" "<i;rn cout<<"\n";rn return 0;rnrn输出:rnrn*b:(b++)->i: 0 0 0 0 0rn derives[i] : rn 0 1 2 3 4rn Other writing method : (b+i)->irn 0 -12615240 -12845056 -12845056 -1rn output derived : (derive+i)->irn 0 1 2 3 4rn output derived : (derive++)->irn 0 1 2 3 4rn Some doubt, Why b++->i output is 0?Then the derives[i].base::i?:rn 0 1 2 3 4rn 论坛

Hop — Don’t Walk!

10-04

DescriptionnnKermit The Frog is a classic video game with a simple control and objective but requires a good deal of thinking. You control an animated frog that can walk and hop, in both forward and backward directions. The frog stands in a space between an otherwise a contiguous line of tiles. Each tile is painted black on one side, and white on the other. The frog can walk (forward, or backward) over an adjacent tile (in front or behind him.) When the frog walks over a tile, the tile slides to the space where the frog was standing. For example, in the adjacent figure, the frog has two tiles behind him, and three in front. We’ll use the notation BWFBBW to refer to this situation where F refers to the space (where the frog is standing,) B is a tile with its black face showing, while W is a tile with its white face showing. The forward direction is from left to right. If the frog were to walk forward, the resulting situation is BWBFBW. Similar behavior when the frog walks backward, the tile behind the frog slides to where the frog was standing. The frog can also hop over the tiles. The frog can hop over an adjacent tile landing on the tile next to it. For example, if the frog was to hop backward, it would land on the first (left-most) tile, and the tile would jump to the space where the frog was standing. In addition, the tile would flip sides. For example, hopping backward in the figure would result in the situation: FWWBBW. We challenge you to write a program to determine the minimum number of moves (walks or hops) to transform one tile configuration into another. n![](http://poj.org/images/3995_1.png)nInputnnYour program will be tested on one or more test cases. Each test case is specified on a single line that specifies string S representing the initial tile arrangement. S is a non-empty string and no longer than 100 characters and is made of the letters ’B’, ’W’, and exactly one ’F’. The last line of the input file has one or more ’-’ (minus) characters.nOutputnnFor each test case, print the following line: nk. M nWhere k is the test case number (starting at one,) and M is the minimum number of moves needed to transform the given arrangement to an arrangement that has no white tile(s) between any of its black tiles. The frog can be anywhere. M is -1 if the problem cannot be solved in less than 10 moves.nSample InputnnWWBBFBWnWWFBWBWnFWBBWBWn---nSample Outputnn1. 0n2. 1n3. 2 问答

Don't Get Rooked

10-08

DescriptionnnIn chess, the rook is a piece that can move any number of squares vertically or horizontally. In this problem we will consider small chess boards (at most 4x4) that can also contain walls through which rooks cannot move. The goal is to place as many rooks on a board as possible so that no two can capture each other. A configuration of rooks is legal provided that no two rooks are on the same horizontal row or vertical column unless there is at least one wall separating them. nnThe following image shows five pictures of the same board. The first picture is the empty board, the second and third pictures show legal configurations, and the fourth and fifth pictures show illegal configurations. For this board, the maximum number of rooks in a legal configuration is 5; the second picture shows one way to do it, but there are several other ways. nn![](http://poj.org/images/1315_1.jpg)nYour task is to write a program that, given a description of a board, calculates the maximum number of rooks that can be placed on the board in a legal configuration. nInputnnThe input contains one or more board descriptions, followed by a line containing the number 0 that signals the end of the file. Each board description begins with a line containing a positive integer n that is the size of the board; n will be at most 4. The next n lines each describe one row of the board, with a '.' indicating an open space and an uppercase 'X' indicating a wall. There are no spaces in the input.nOutputnnFor each test case, output one line containing the maximum number of rooks that can be placed on the board in a legal configuration.nSample Inputnn4n.X..n....nXX..n....n2nXXn.Xn3n.X.nX.Xn.X.n3n...n.XXn.XXn4n....n....n....n....n0nSample Outputnn5n1n5n2n4 问答

没有更多推荐了,返回首页