 Unix Robots

Wyest is fond of the game Unix Robots. It is played on a twodimensional rectangular board. The objective of the game is to escape from a number of robots, which have been programmed with only a single objective: to kill you.
The player character and the robots start at randomly selected grids in the board. Every time the player character moves a square in any direction (horizontally, vertically, or diagonally), so does each robot, in whichever direction is the shortest way. That is, if a robot has two optimal approaches, it will first make xrobot  xman and yrobot  yman both smaller (move diagonally). (In fact there're robots moving two squares in some sets of Unix Robots, but now we're not considering them.) If the player character collides with a robot, he dies and the game ends. However, the robots are also fatal to each other  when two robots collide, they both die, leaving behind a junkheap. These junkheaps are also fatal to robots.
You can also transport into a grid in cases where moving is otherwise impossible. There're two kinds of transports, one is safe teleport, which has a limit of using, and the other is random. if you have no more safe ones, you'll have to be transported into a randomly selected location, maybe right into the path of a robot.
Generally, the player will gain one safe teleport moving onto the next level, no doubt it's too few. So the Wait button is introduced to you. If you press it, you will no longer be able to move until either all of the robots (which still move towards you) are gone, or you are killed. If you survive finally, each robot will earn you one extra safe teleports to use in future.
Now Wyest is playing the game again, and is asking you to do her a little favor. Given the situation on the board, you only need to tell her whether she can press the Wait button now.
Input
There're multiple test cases. In each test case, the first line contains two integers x and y, coordinates of the grid where the player character is. The second line of a case is an integer n, indicating the number of robots, and n lines follow, each contains two integers xi and yi, coordinates of the grid where roboti is. Then a single line containing an integer m, indicating the number of junkheaps of previous collisions on the board, and m lines follow, each contains two integers xj and yj, coordinates of the grid where junkheapj is.
0 < n <= 100, 0 <= m <= 100. All coordinates between 500000000 and 500000000, and you can safely assume that in each case, no two things are in the same grid initially.Output
A single line for each case telling whether Wyest can Wait in the current situation, either "YES" or "NO".
Sample Input
0 0
2
3 1
3 1
0
0 0
1
2 0
1
3 0
Sample OutputYES
NO
The Game of 31 的问题_course
20191231Problem Description The game of 31 was a favourite of con artists who rode the railroads in days of yore. The game is played with a deck of 24 cards: four labelled each of 1, 2, 3, 4, 5, 6. The cards in the deck are visible to both players, who alternately withdraw one card from the deck and place it on a pile. The object of the game is to be the last player to lay a card such that the sum of the cards in the pile does not exceed 31. Your task is to determine the eventual winner of a partially played game, assuming each player plays the remainder of the game using a perfect strategy. For example, in the following game player B wins: Player A plays 3 Player B plays 5 Player A plays 6 Player B plays 6 Player A plays 5 Player B plays 6 Input The input will consist of several lines; each line consists of a sequence of zero or more digits representing a partially completed game. The first digit is player A's move; the second player B's move; and so on. You are to complete the game using a perfect strategy for both players and to determine who wins. Output For each game, print a line consisting of the input, followed by a space, followed by A or B to indicate the eventual winner of the game. Sample Input 356656 35665 3566 111126666 552525 Sample Output 356656 B 35665 B 3566 A 111126666 A 552525 A
C++ 计算行列式的方法_course
20141201C++新手，想要用C++实现一个计算行列式值的函数，行列式的输入储存方法已经完成（代码如下），求determinant函数（即计算行列式的值）部分的写法，谢谢！ #include <iostream> #include <iomanip> using namespace std; void square() { int in_n; cin >> in_n; const int n = in_n; int square[n][n]; int squarei[n]; for(int j = 0;j < n;j ++) { for(int i = 0;i < n;i ++) { cin >> squarei[i]; square[j][i] = squarei[i]; } } cout << endl; for(int j = 0;j < n;j ++) { for(int i = 0;i < n;i ++) { cout << square[j][i] << " "; } cout << endl; } determinant(square); } void determinant(int square) { } int main() { square(); return 0; }
Magic Square _course
20170327In recreational mathematics, a magic square of ndegree is an arrangement of n2 numbers, distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to the same constant. For example, the picture below shows a 3degree magic square using the integers of 1 to 9. Given a finished number square, we need you to judge whether it is a magic square. Input The input contains multiple test cases. The first line of each case stands an only integer N (0 < N < 10), indicating the degree of the number square and then N lines follows, with N positive integers in each line to describe the number square. All the numbers in the input do not exceed 1000. A case with N = 0 denotes the end of input, which should not be processed. Output For each test case, print "Yes" if it's a magic square in a single line, otherwise print "No". Sample Input 2 1 2 3 4 2 4 4 4 4 3 8 1 6 3 5 7 4 9 2 4 16 9 6 3 5 4 15 10 11 14 1 8 2 7 12 13 0 Sample Output No No Yes Yes
Android布局设计及实现的问题_course
20150114![图片说明](https://imgask.csdn.net/upload/201501/14/1421217780_869472.png) 实现如图片的效果，该图片仅为ListView的一个item。Item的大布局为RelativeLayout（其背景是圆角图片），内部的图片为ImageView，第一行字为一个TextView，第二行字及按钮为LinearLayout。问题有：1、图片不能靠顶填充，左右有间隙或上下有间隙，即使使用match_parent；2、最后一行文字距底部的空隙过大，设置padding、margin等无效果。 请各位看官给点意见，拜谢~ 附List_view_item.xml <?xml version="1.0" encoding="utf8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/ic_topic_item_bg" android:layout_gravity="fill_vertical" android:gravity="centerfill" > <ImageView android:id="@+id/square_topic_image" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:contentDescription="@null" android:src="@drawable/default_topic_thumb" /> <LinearLayout android:id="@+id/square_topic_item_fl" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/square_topic_image" android:layout_centerHorizontal="true" android:orientation="vertical" android:paddingLeft="@dimen/square_topic_item_padding" android:paddingRight="@dimen/square_topic_item_padding" > <RelativeLayout android:id="@+id/square_topic_title_rl" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="fill_horizontal" > <TextView android:id="@+id/square_topic_title_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:alpha="50" android:gravity="leftcenter" android:textColor="@android:color/black" android:textSize="@dimen/square_topic_title_size" /> <LinearLayout android:id="@+id/topic_praise_favourite_rl" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:gravity="centerfill" android:orientation="horizontal" > <TextView android:id="@+id/topic_praise" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:drawableLeft="@drawable/ic_small_praise_d" android:padding="@dimen/square_topic_praise_favourite_space" android:textColor="@color/dark_gray" android:textSize="@dimen/square_topic_text_size" /> <View android:layout_width="1dp" android:layout_height="match_parent" android:layout_gravity="center" android:background="@color/dark_gray" android:padding="@dimen/square_topic_praise_favourite_space" /> <TextView android:id="@+id/topic_favourite" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:drawableLeft="@drawable/ic_small_favourite_d" android:padding="@dimen/square_topic_praise_favourite_space" android:textColor="@color/dark_gray" android:textSize="@dimen/square_topic_text_size" /> </LinearLayout> </RelativeLayout> <TextView android:id="@+id/square_topic_introduction_tv" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="0dp" android:gravity="leftcenter" android:textColor="@android:color/black" android:textSize="@dimen/square_topic_text_size" /> </LinearLayout> </RelativeLayout> ``` ```
C#winform删除动态添加的多个控件_course
20170113动态添加了10个控件，如下：其中RandomSquare.Square是自定义控件， RandomSquare.Square[] ns = new RandomSquare.Square[1000]; ns[0] = new RandomSquare.Square(); ns[0].Parent = tabPage_Database; ns[0].Location = new Point(200,200); ns[0].Size = new Size(50, 50); tabPage_Database.Controls.Add(ns[0]); for (int i=1;i<=9;i++) { ns[i]= new RandomSquare.Square(); ns[i].Parent = tabPage_Database; ns[i].Size = new Size(50, 50); ns[i].Location = new Point(ns[i  1].Location.X + ns[i  1].Width, ns[i  1].Location.Y); tabPage_Database.Controls.Add(ns[i]); } 动态删除(例如点击一个btn)代码如下： private void button3_Click(object sender, EventArgs e) { foreach (Control ns in tabPage_Database.Controls) { if (ns.GetType().ToString().Equals("RandomSquare.Square")) { tabPage_Database.Controls.Remove(ns); } } } 点玩按钮后，控件删除总会剩下两个，这是为什么？ 如图： 点击前： ![图片说明](https://imgask.csdn.net/upload/201701/13/1484294578_31816.png) 点击后： ![图片说明](https://imgask.csdn.net/upload/201701/13/1484294597_783335.png)
To Bet or Not To Bet _course
20171017Description Alexander Charles McMillan loves to gamble, and during his last trip to the casino he ran across a new game. It is played on a linear sequence of squares as shown below. ![](http://poj.org/images/1644_1.jpg) A chip is initially placed on the Start square. The player then tries to move the chip to the End square through a series of turns, at which point the game ends. In each turn a coin is fl ipped: if the coin is heads the chip is moved one square to the right and if the coin is tails the chip is moved two squares to the right (unless the chip is one square away from the End square, in which case it just moves to the End square). At that point, any instruction on the square the coin lands on must be followed. Each instruction is one of the following: 1. Move right n squares (where n is some positive integer) 2. Move left n squares (where n is some positive integer) 3. Lose a turn 4. No instruction After following the instruction, the turn ends and a new one begins. Note that the chip only follows the instruction on the square it lands on after the coin flip. If, for example, the chip lands on a square that instructs it to move 3 spaces to the left, the move is made, but the instruction on the resulting square is ignored and the turn ends. Gambling for this game proceeds as follows: given a board layout and an integer T, you must wager whether or not you think the game will end within T turns. After losing his shirt and several other articles of clothing, Alexander has decided he needs professional helpnot in beating his gambling addiction, but in writing a program to help decide how to bet in this game. Input Input will consist of multiple problem instances. The first line will consist of an integer n indicating the number of problem instances. Each instance will consist of two lines: the first will contain two integers m and T (1 <= m <= 50, 1 <= T <= 40), where m is the size of the board excluding the Start and End squares, and T is the target number of turns. The next line will contain instructions for each of the m interior squares on the board. Instructions for the squares will be separated by a single space, and a square instruction will be one of the following: +n, n, L or 0 (the digit zero). The first indicates a right move of n squares, the second a left move of n squares, the third a loseaturn square, and the fourth indicates no instruction for the square. No right or left move will ever move you off the board. Output Output for each problem instance will consist of one line, either Bet for. x.xxxx if you think that there is a greater than 50% chance that the game will end in T or fewer turns, or Bet against. x.xxxx if you think there is a less than 50% chance that the game will end in T or fewer turns, or Push. 0.5000 otherwise, where x.xxxx is the probability of the game ending in T or fewer turns rounded to 4 decimal places. (Note that due to rounding the calculated probability for display, a probability of 0.5000 may appear after the Bet for. or Bet against. message.) Sample Input 5 4 4 0 0 0 0 3 3 0 1 L 3 4 0 1 L 3 5 0 1 L 10 20 +1 0 0 1 L L 0 +3 7 0 Sample Output Bet for. 0.9375 Bet against. 0.0000 Push. 0.5000 Bet for. 0.7500 Bet for. 0.8954
Light The Square _course
20170826There is a new square been built in hangzhou,now in order to light the whole square in the night,it must need a lots of lights. The government is lack of finance,so they want the the number of lights to be least.So they ask you to help. To simplify the problem,the square can be see as a n��m rectangle. And lights are placed in this grids.If one grid has a light,its left, up, right, down grid can also be bright.Given m and n,Write a program to calculate the mininum number of lights. Input The input file will contain one or more test cases,Each test case contains of one line containing two integers 0<n<150 and 0<m<9,separated by a space.The input file is end with m=n=0.and this case should not proceed. Output For each test case,output one line "The square S need(s) L lights.",where S is the test case,L is the mininum number of this square. Sample Input 1 1 2 2 3 3 0 0 Sample Output The square 1 need(s) 1 lights. The square 2 need(s) 2 lights. The square 3 need(s) 3 lights.
Big Square _course
20161231Description Farmer John's cows have entered into a competition with Farmer Bob's cows. They have drawn lines on the field so it is a square grid with N × N points (2 ≤ N ≤ 100), and each cow of the two herds has positioned herself exactly on a gridpoint. Of course, no two cows can stand in the same gridpoint. The goal of each herd is to form the largest square (not necessarily parallel to the gridlines) whose corners are formed by cows from that herd. All the cows have been placed except for Farmer John's cow Bessie. Determine the area of the largest square that Farmer John's cows can form once Bessie is placed on the field (the largest square might not necessarily contain Bessie). Input Line 1: A single integer, N Lines 2..N+1: Line i+1 describes line i of the field with N characters. The characters are: 'J' for a Farmer John cow, 'B' for a Farmer Bob cow, and '*' for an unoccupied square. There will always be at least one unoccupied gridpoint. Output Line 1: The area of the largest square that Farmer John's cows can form, or 0 if they cannot form any square. Sample Input 6 J*J*** ****** J***J* ****** **B*** ****** Sample Output 4
入门小白求解北京2004ACM的Square题_course
20160213入门小白开始啃题，然而啃不动（无奈摊手） 求大神帮忙解答（最好是有解释啦）(ฅ>ω<*ฅ) SquareTime Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KBTotal submit users: 177, Accepted users: 26Problem 10002 : No special judgementProblem descriptionGiven a square at [0, 1] * [0, 1] that has N points ( P1, P2, ..., PN ) in the square (you may assume that different points can be at the same position), we can connect the N points and the four corners of the square with some line segments so that through these segments any two of the N+4 points can reach each other (directly or indirectly). The graph length is defined as the total length of the line segments. When N points' positions are fixed, there must exist a way of connecting them, such that it will make the shortest graph length. We can use LEN (P1, P2, ..., PN) to record the graph length using this way of connecting. In this situation, LEN (P1, P2, ..., PN) is a function of P1, P2, ..., PN. When P1, P2, ..., PN change their positions, LEN (P1, P2, ..., PN) also changes. It's easy to prove that there exist some P1', P2', ..., PN' in the square such that LEN (P1', P2', ..., PN') is at its minimum. Given the initial positions of N points, your task is to find out N points P1", P2", ..., PN" in the square such that P1P1" + P2P2" + ... + PNPN" is minimum and LEN (P1", P2", ..., PN") = LEN (P1', P2', ..., PN') . You are requested to output the value of P1P1" + P2P2" + ... + PNPN", where PiPi" is the distance between Pi and Pi". ?￼ For example, Figure1 gives the initial position of P1 and the way of connecting to obtain LEN (P1). In Figure2, it gives the position of P1", which is at the center of the square, and the way of connecting to obtain LEN (P1"). It can be proved that LEN (P1") = LEN (P1?); your job is to output the distance between P1 and P1". InputThe input consists of several test cases. For each test case, the first line consists of one integer N (1 <= N <= 100), the number of points, and N lines follow to give the coordinates for every point in the following format: x y Here, x and y are float numbers within the value [0, 1]. A test case of N = 0 indicates the end of input, and should not be processed. OutputFor each test case, output the value of P1P1" + P2P2" + ... + PNPN". The value should be rounded to three digits after the decimal point. Sample Input1 0.2 0.5 2 0 0.5 0.5 0.5 0Sample Output0.300 0.500Judge Tips费马点 Problem SourceBeijing 2004![图片](https://imgask.csdn.net/upload/201602/13/1455372077_80112.png)
Dice Contest _course
20170803Description Everyone loves gambling in the Dicent City. Every Saturday the whole community meets to attend a dice contest. They started a few years ago with a classic sixsided die with 1 to 6 dots displayed on the sides and had a lot of fun. However they soon got bored and that's why more sophisticated dice are in use nowadays. They put a sticker on each side and write a positive integer on each sticker. The contest is run on a strip divided into squares in a chessboardlike manner. The strip is 4 squares wide and infinite to the left and to the right (is anyone going to say it can't exist in the real world, huh?). The rows of the strip are numbered from 1 to 4 from the bottom to the top and the columns are numbered by consecutive integers from the left to the right. Each square is identified by a pair (x,y) where x is a column number and y is a row number. The game begins with a die placed on a square chosen be a contest committee with onedot side on the top and twodots side facing the player. To move the die the player must roll the die over an edge to an adjacent (either horizontally or vertically) square. The number displayed on the top of the die after a roll is the cost of the move. The goal of the game is to roll the die from the starting square to the selected target square so that the sum of costs of all moves is minimal. Task Write a program that: reads the description of a die, a starting square and a target square, computes the minimal cost of rolling the die from the starting square to the target square, writes the result. Note: all teams participating in the contest received dice from the organisers. Input The first line of the input contains six integers l1, l2, l3, l4, l5, l6 (1 < = li < = 50) separated by single spaces. Integer li is the number written on a side having originally i dots. The second line of the input contains four integers x1, y1, x2, y2 ( 109 < = x1, x2 < = 109, 1 <= y1, y2 < = 4) separated by single spaces. Integers x1, y1 are the column and the row number of the starting square respectively. Integers x2, y2 are the column and the row number of the target square respectively. Output The first and the only line of the output should contain the minimal cost of rolling the die from the starting square to the target square. Sample Input 1 2 8 3 1 4 1 1 0 2 Sample Output 7
用结构和枚举，把国际象棋棋盘上的棋子，和格子颜色初始化为开局状态_course
20180423我这个有20多处错误，请大佬看看 #include<stdio.h> typedef enum {SOLDIER,HORSE,X,CAR,QUEEN,KING,EMPTY}Piece; typedef enum {BLACK,WHITH}Color; struct square{Piece a;Color b;}; int main(void) { int i,j; struct square board[8][8]; (board[0][0].square.a)=(board[0][7].square.a)=(board[7][0].square.a)=(board[7][7].square.a)=CAR; (board[0][1].square.a)=(board[0][6].square.a)=(board[7][1].square.a)=(board[7][6].square.a)=HORSE; (board[0][2].square.a)=(board[0][5].square.a)=(board[7][2].square.a)=(board[7][5].square.a)=X; (board[0][3].square.a)=(board[7][4].square.a)=QUEEN; (board[0][4].square.a)=(board[7][3].square.a)=KING; for(i=0;i<8;i++) board[1][i].square.a=board[7][i].square.a=SOLDIER; for(i=0;i<8;i++){ for(j=0;j<8;j++){ if(j%2=0) baord[i][j].square.b=WHITH; else board[i][j].square.b=BLACK; } } for(i=2;i<6;i++){ for(j=0;j<8;j++) board[i][j].square.a=EMPTY; } printf("输入方格坐标："); scanf("%d %d",&i,&j); printf("棋子：%d颜色：%d",board[i][j].square.a,board[i][j].square.b); return 0; } 以下是错误信息： ompiling... chapter16exercise18.c D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(11) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(11) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(11) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(11) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(12) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(12) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(12) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(12) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(13) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(13) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(13) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(13) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(14) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(14) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(15) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(15) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(17) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(17) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(20) : error C2106: '=' : left operand must be lvalue D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(21) : error C2065: 'baord' : undeclared identifier D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(21) : error C2109: subscript requires array or pointer type D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(21) : error C2109: subscript requires array or pointer type D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(21) : error C2224: left of '.square' must have struct/union type D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(23) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(28) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(33) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(33) : error C2039: 'square' : is not a member of 'square' D:\c\c\第十六章结构联合枚举\chapter16exercise18.c(4) : see declaration of 'square' Error executing cl.exe. chapter16exercise18.obj  27 error(s), 0 warning(s)
这个程序为什么得不到平方表？_course
20141015#include <iostream.h> //#include <math.h> int square(int); int main() { for(int x=1;x<=10;x++) { cout<<square(x)<<" "; cout<<endl; return 0; } } // function definition int square(int y) { return y*y; } 这是书上的例子，执行结果应该是 1 4 9 16 25 36 49 64 81 100 但是我在电脑执行的结果只有 1 我把int main 改成 void main 将return 0注释掉才能得到结果，这是什么原因？
Square in Circle _course
20170330How many squares can be cut from a circle at most. The problem comes from semiconductor industry. We want to know how many silicon chips can be cut from a circular wafer. And for some technical reason, all squares'(chips) sides should be parallel and it is only allowed to cut the circular wafer into several strips at the first working procedure. NOTE: The chips in the circle should not be divided into pieces. Input Two numbers indicates the sidelength of square and the radius of circle respectively. Two 0 indicates the end of the input. Output A number of squares on a single line which is guaranteed to fit a signed 16bit integer. Sample Input 1 1.42 1 0.8 0 0 Sample Output 4 1
C语言n层嵌套平方根的计算 不知道哪里错了，，_course
20171119#include <stdio.h> double Y(double x,int n) { if(n == 0) return 0; else return (square(x + Y(x,n1))); } int main() { double a;int b;float result; printf("Please input x and n:"); scanf("%lf,%d",&a,&b); result=Y(a,b); printf("Result=%.2f\n",result); return 0; }
C语言新人求解,关于静态变量_course
20161031#include <stdio.h> int Square(int i) { return i * i; } int main(void) { int i = 0; i = Square(i); for ( ; i<3; i++) { static int i = 1; i += Square(i); printf("%d,", i); } printf("%d\n", i); return 0; } 求大大们帮我看看i是怎么运行得呀，输出结果是2,6,42,3，但是我老想不明白......
Perfect Pth Powers _course
20170908We say that x is a perfect square if, for some integer b, x = b2. Similarly, x is a perfect cube if, for some integer b, x = b3. More generally, x is a perfect pth power if, for some integer b, x = bp. Given an integer x you are to determine the largest p such that x is a perfect pth power. Input Each test case is given by a line of input containing x. The value of x will have magnitude at least 2 and be within the range of a (32bit) int in C, C++, and Java. A line containing 0 follows the last test case. Output For each test case, output a line giving the largest integer p such that x is a perfect pth power. Sample Input 17 1073741824 25 0 Sample Output 1 30
poj3009题无法AC，但是测试数据对，如何解决_course
20140906#include<cstdio> int ans; int dx[4]={1,0,1,0},dy[4]={0,1,0,1}; int m,n; int square[30][30]={0}; void dfs(int x,int y,int step); int main() { int i,j; int p,q; ans=12; while(scanf("%d%d",&m,&n)!=EOF&&(m+n)) { for(i=0;i<n;i++) for(j=0;j<m;j++) { scanf("%d",&square[i][j]); if(square[i][j]==2) { square[i][j]=0; p=i; q=j; } } dfs(p,q,0); if(ans<11) printf("%d\n",ans); else printf("1\n"); } } void dfs(int x,int y,int step) { int i,xx1,yy1,xx,yy; if(step>10) return; for(i=0;i<4;i++) { xx=x+dx[i]; yy=y+dy[i]; if(step<ans&&xx>=0&&xx<n&&yy>=0&&yy<m&&square[xx][yy]!=1) { while(xx>=0&&xx<n&&yy>=0&&yy<m&&square[xx][yy]==0) { xx=xx+dx[i]; yy=yy+dy[i]; } xx1=xxdx[i]; yy1=yydy[i]; if(xx>=0&&xx<n&&yy>=0&&yy<m) { if(square[xx][yy]==3) ans=step+1; else { square[xx][yy]=0; dfs(xx1,yy1,step+1); square[xx][yy]=1; } } } } }
The Umbrella Problem: 2054 _course
20171011Description "Forget it," Garret complained, throwing down the controller to his PlayStation VIII, "this level is impossible." He had just "died" for the 17th time on level 54 of the game "Lemmings 9: Lost in Space". "No it isn't," his brother Ferret replied, "and I can prove it." Ferret pulled his PlaySkool PDA from the back pocket of his Levi's Huggies. "First, picture the level as a rectangular grid." Ferret punched a few of the buttons on his PDA and a rectangle appeared as he described. "Your character, a Lemming holding an umbrella, starts at the top of this rectangle. His goal is to reach the bottom without dying." "I know that, you weasel, but what about the laser guns?" Garret whined. "The name is Ferret, and I was just getting to that. If we represent the level as a rectangular grid, then the Lemming can occupy one square and each laser gun can occupy a square. Remember the laser guns are cyclic: they all shoot up the first turn, right the second turn, down the third turn, left the fourth turn, and then repeat the sequence." "But you're forgetting the pits of lava!" Garret exclaimed. "You didn't let me finish. Each pit of lava also occupies a square. And each plot of grass, the Lemming's destination, can also occupy a square. Then, it's just a matter of manipulating the Lemming and laser beams in a series of turns to determine if it is possible for the Lemming to reach the bottom without 'dying'." "You think you're so smart, Ferret, let's see if you can explain that again in a clear, concise way." "Certainly": The level will consist of a grid of squares. The way each laser beam and the Lemming moves can be described in "turns". To determine if the Lemming can reach the bottom of the level without dying, Ferret devised some rules: Each turn will consist of two steps: First, the laser guns will "fire" and maintain until the end of the turn, a beam in a direction dependent on the number of the turn. On the first turn, each laser gun will shoot up (all squares directly above a laser gun are "unsafe" and cannot be occupied by the Lemming); on the second turn, each laser gun will shoot right; on the third turn, each laser gun will shoot down; on the fourth turn, each laser gun will shoot left; on the fifth turn, the sequence will repeat. Example: Column 01234 R 0 L < The Lemming will always start in a column on row 0 o 1  In this example, on the first turn, the laser beam w 2 S  will occupy squares (3,0),(3,1); second turn, (4,2); 3  third turn, (3,3),(3,4),(3,5),(3,6); fourth turn, 4  (0,2),(1,2),(2,2); fifth turn (repeating), (3,0),(3,1), etc. 5  (squares are represented using (column,row) notation) 6GPPGG< The pits of lava and grass squares will always be in the last row Second, the Lemming will always move one row down, but to any one of three columns: one column to the left, one column to the right, or remain in the same column. In the above example, on the first turn the Lemming (L) could move to square (1,1), (2,1), or (3,1) (if he moved to (3,1), though, he would die because of the laser beam). However, on any turn the Lemming cannot move outside of the grid (i.e., he cannot move to column 1, or to a column number equal to the number of columns). The level is considered "possible" if the Lemming can reach any "grass" square without dying after a series of turns. The Lemming will die if at any point he occupies the same square as a laser gun, its beam, or a pit of lava. This includes: The Lemming moving into a square a pit of lava occupies, The Lemming moving into a square a laser gun occupies, The Lemming moving into a square a laser beam occupies (even if it is a grass square!), A laser gun firing a beam into a square the Lemming occupies Input Input to this problem will consist of a (nonempty) series of up to 100 data sets. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets. Each data set will describe the starting conditions of the level. A single data set has the following components: Start line  A single line, "START x y", where 0 < x < 10 and x is the number of columns in the grid representing the level and 1 < y < 10 and y is the number of rows in the grid representing the level. The next y lines will represent the rows of the level, starting with row 0 (the top). Each line will consist of x letters. The letters will represent components of the level as follows: L  Lemming (there will only be one 'L' per data set, and it will always be in row 0) S  laser gun (these squares will never be in the final row) P  pit of lava (these squares will always be in the final row) G  grass (these squares will also always be in the final row) O  "empty" square of air End line  A single line, "END". Following the final data set will be a single line, "ENDOFINPUT". Output Output for each data set will be exactly one line. The line will either be "FERRET" or "GARRET" (both all caps with no whitespace leading or following). "FERRET" will appear if the Lemming can make it safely (without dying) to any grass square at the bottom of the level after a series of turns. "GARRET" will be output for a data set if it fails to meet the criteria for a "FERRET" line.
Square _course
20161228Description Given a set of sticks of various lengths, is it possible to join them endtoend to form a square? Input The first line of input contains N, the number of test cases. Each test case begins with an integer 4 <= M <= 20, the number of sticks. M integers follow; each gives the length of a stick  an integer between 1 and 10,000. Output For each case, output a line containing "yes" if is is possible to form a square; otherwise output "no". Sample Input 3 4 1 1 1 1 5 10 20 30 40 50 8 1 7 2 6 4 4 3 5 Sample Output yes no yes
Warez Test _course
20161121Description Background Our hero Jimmy is deeply in love with Christine and wants to marry her. So far so good, but Christine is the daughter of Mr. Warez, the owner of nearly all the warehouses in town. And Mr. Warez will never let his daughter marry someone who is not working for him. The sad point is that you may not work for Mr. Warez at all if you do not know how to push boxes in a warehouse properly. So Jimmy has to pass the infamous "Warez Test" first. The Problem Jimmy receives a number of maps each showing the outline of a warehouse. A map consists of squares. On one square there can be a wall or a single box or it can be empty. One or more squares are marked as target squares. One square is marked as the starting point for Jimmy. Jimmy can move in four directions only: north, west, east and south. Jimmy can only move to an empty square or a square that is occupied by a box that can be pushed to the next square in the direction Jimmy is moving. This next square has to be empty which means that as a result of Jimmy moving one square at most one box can be moved exactly one square. By the way: Squares with a wall on it are not empty. . . The border of every map (the first and last row and first and last column of the map) is always occupied by walls. On every map there are always as many boxes as there are target squares and there is always at least one box. It is Jimmy's task to find the shortest way to push the boxes onto the target squares so that at the end each box stands on a target square. To determine if one way is shorter than the other only the moves of Jimmy are counted, no matter whether he thereby pushes a box or not. For every map it is guaranteed that there is exactly one shortest solution. Input The first line contains the number of scenarios (maps). For each map the first line contains the number of rows and columns of the map (both less than or equal to 15) separated by a blank. Then follows the map where 'X' indicates a square with a wall on it, 'T' indicates a target square and '.' indicates an empty square. In the next line follows the starting position of Jimmy (row and column separated by a blank), then follows the number of boxes in the line after that. The following lines contain the starting positions of the boxes (one box per line, row and column separated by a blank). The numbering of rows and columns starts with 0 in the upper left corner. Output The output for every scenario begins with a line containing "Scenario #i:", where i is the number of the scenario starting with 1. In the next line print the moves Jimmy has to make following the shortest possible solution. Print the letter 'n' for Jimmy moving north (up), 'w' for west (left), 'e' for east (right) and 's' for south (down). The output for each scenario should be followed by a blank line. Sample Input 2 8 6 XXXXXX X.T..X X....X X....X X....X X....X X....X XXXXXX 5 3 1 4 3 5 4 XXXX X.XX X..X XT.X XXXX 1 1 1 2 1 Sample Output Scenario #1: nnnenw Scenario #2: s
Python数据分析与挖掘
2018010892讲视频课+16大项目实战+源码+￥800元课程礼包+讲师社群1V1答疑+社群闭门分享会=99元 为什么学习数据分析？ 人工智能、大数据时代有什么技能是可以运用在各种行业的？数据分析就是。 从海量数据中获得别人看不见的信息，创业者可以通过数据分析来优化产品，营销人员可以通过数据分析改进营销策略，产品经理可以通过数据分析洞察用户习惯，金融从业者可以通过数据分析规避投资风险，程序员可以通过数据分析进一步挖掘出数据价值，它和编程一样，本质上也是一个工具，通过数据来对现实事物进行分析和识别的能力。不管你从事什么行业，掌握了数据分析能力，往往在其岗位上更有竞争力。 本课程共包含五大模块： 一、先导篇： 通过分析数据分析师的一天，让学员了解全面了解成为一个数据分析师的所有必修功法，对数据分析师不在迷惑。 二、基础篇： 围绕Python基础语法介绍、数据预处理、数据可视化以及数据分析与挖掘......这些核心技能模块展开，帮助你快速而全面的掌握和了解成为一个数据分析师的所有必修功法。 三、数据采集篇： 通过网络爬虫实战解决数据分析的必经之路：数据从何来的问题，讲解常见的爬虫套路并利用三大实战帮助学员扎实数据采集能力，避免没有数据可分析的尴尬。 四、分析工具篇： 讲解数据分析避不开的科学计算库Numpy、数据分析工具Pandas及常见可视化工具Matplotlib。 五、算法篇： 算法是数据分析的精华，课程精选10大算法，包括分类、聚类、预测3大类型，每个算法都从原理和案例两个角度学习，让你不仅能用起来，了解原理，还能知道为什么这么做。
 24.46MB
图书管理系统（Java + Mysql）我的第一个完全自己做的实训项目
20190104图书管理系统 Java + MySQL 完整实训代码，MVC三层架构组织，包含所有用到的图片资源以及数据库文件，大三上学期实训，注释很详细，按照阿里巴巴Java编程规范编写
征服C++ 11视频精讲
20160902【为什么还需要学习C++？】 你是否接触很多语言，但从来没有了解过编程语言的本质？ 你是否想成为一名资深开发人员，想开发别人做不了的高性能程序？ 你是否经常想要窥探大型企业级开发工程的思路，但苦于没有基础只能望洋兴叹？ 那么C++就是你个人能力提升，职业之路进阶的不二之选。 【课程特色】 1.课程共19大章节，239课时内容，涵盖数据结构、函数、类、指针、标准库全部知识体系。 2.带你从知识与思想的层面从0构建C++知识框架，分析大型项目实践思路，为你打下坚实的基础。 3.李宁老师结合4大国外顶级C++著作的精华为大家推出的《征服C++11》课程。 【学完后我将达到什么水平？】 1.对C++的各个知识能够熟练配置、开发、部署； 2.吊打一切关于C++的笔试面试题； 3.面向物联网的“嵌入式”和面向大型化的“分布式”开发，掌握职业钥匙，把握行业先机。 【面向人群】 1.希望一站式快速入门的C++初学者； 2.希望快速学习 C++、掌握编程要义、修炼内功的开发者； 3.有志于挑战更高级的开发项目，成为资深开发的工程师。 【课程设计】 本课程包含3大模块 基础篇 本篇主要讲解c++的基础概念，包含数据类型、运算符等基本语法，数组、指针、字符串等基本词法，循环、函数、类等基本句法等。 进阶篇 本篇主要讲解编程中常用的一些技能，包含类的高级技术、类的继承、编译链接和命名空间等。 提升篇： 本篇可以帮助学员更加高效的进行c++开发，其中包含类型转换、文件操作、异常处理、代码重用等内容。
 下载 从控制器角度看感应电容触控系统的设计
 下载 选购主板需要注意的事项总结
 学院 2020年软考网络规划设计师论文写作套路精讲视频课程
 博客 基于java的电子病历管理系统ssh框架
 下载 Maven的学习使用
 下载 图像传感器实现监控摄像头创新应用
 学院 PHP微信小程序家具家居商城 大学生毕业设计 教学视频
 下载 电源技术中的业界首款数字电流传感器及电压监控器器件LMP9206 问世
 下载 PHP中对汉字进行unicode编码和解码的实现方法(必看)
 学院 MT5智能交易之路：MQL5语法指南
 学院 PHP微信小程序校园图书商城 大学生毕业设计 教学视频
 博客 使用vscode打造ros神器
 下载 基于C8051F系列单片机的血糖仪电路原理设计与应用分析
 博客 java基础回顾之对象空值判断的方法
 博客 Antd 4 获取Form字段值
 下载 node.js的事件机制
 博客 正则表达式验证体重 支持小数点输入前三位小数点后两位（例：100.23）
 学院 Java小白学习方法指南！避开思维惯性！让学习事半功倍
 博客 傅里叶频谱分析
 学院 Python数据处理与特征工程
 博客 navicat安装
 博客 python类的一些内置函数
 学院 Android Jetpack架构组件及MVVM架构
 学院 PHP微信小程序珠宝首饰商城 大学生毕业设计 教学视频
 博客 工业级云监控记录系统ZWACS实现微信报警功能
 下载 详解物联网技术框架
 下载 电源技术中的关于DC/DC转换器电路设计的技巧
 博客 开发者案例  灵活高效涂鸦社区PaaS,助力社区智能化升级
 博客 使用 1D 卷积和 LSTM 混合模型做 EEG 信号识别
 博客 jvm加载字节码过程