4个回答

Yiffy_ 用了qt, 要根据用户输入的数据来画网络图， 数据会不一样。该怎么通过不同的数据来画不同的网络图呢
2 年多之前 回复
Yiffy_ 网络图怎么用C++画出来？
2 年多之前 回复

Java 、JS编程如何解决双代号时标网络图问题

Problem Description You are a secret agent for the Eternally Indebted External Intelligence Office (EIEIO) of the country of Nomoneo. Headquarters has disguised your one-time pad for encrypted communications in the form of a Rubik's Cube? (For those of you unfamiliar with the puzzle, a Rubik's Cube?comes in the form of a cube where each face is divided into three rows and three columns (nine "squares". Any of the six faces of the cube may be rotated either clockwise or counterclockwise, which also rotates the three nearest squares on each adjoining face onto a new face, respectively. When solved (or taken from the factory packaging), each face of the cube contains squares of only one color. There is no way to change the relationship between the colors of the central squares on each face.) The cube has been pre-scrambled and you are to apply a certain set of moves to the cube based on the message you want to return. This diagram provides the relationship between the sides of the cube as well as the orientation of the faces for the purposes of input and output. It should be viewed as an unfolded cube with the text on the outside. The faces are indicated by the color of the central subdivision (square) and are White, Orange, Red, Blue, Green, and Yellow. The corner with the dot is the top left corner for purposes of input and output. Input Your program should read the input data from the file, which consists of several cases. The first line of the input will give the number of these input cases (as a decimal integer without any punctuation), which will be greater than or equal to 1 and less than or equal to 10,000. Each case consists of three lines giving the initial state of the puzzle cube and one line giving the rotations you must apply to reach the appropriate final state of the cube. Each of the three lines giving the initial state of the cube consists of 18 letters with a single space between each pair of letters. There is no space between the last letter and the end of the line. Each of the letters is 'W', 'O', 'R', 'B', 'G', or 'Y' indicating the respective color. The faces are listed from left to right in the order (by central square color) White, Orange, Red, Blue, Green, Yellow. Thus, the first three columns of letters give the state of the "White" face, and so forth. The fourth line of the case gives the manipulations that you must apply to the cube. Each manipulation consists of a single letter as above ('W', 'O', 'R', 'B', 'G', or 'Y') indicating which face (selected by the color of the center) you should rotate. Each rotation thus indicated is a 90?clockwise rotation of the face with respect to the rest of the cube, looking at the face to be rotated. At least one and no more than 1,000 manipulations will be specified. Output Print to standard output the state of the cube after the indicated manipulations. Use the same format as for input: three lines, each containing 18 color letters separated by a single space character. Do not put a space after the final letter on the line. Print out the faces in the same order, left to right, as for input: White, Orange, Red, Blue, Green, Yellow. After each output case, print a line containing 35 '=' characters. Sample Input 2 W W W O O O R R R B B B G G G Y Y Y W W W O O O R R R B B B G G G Y Y Y W W W O O O R R R B B B G G G Y Y Y RG Y G G Y G W Y W B R W O R W G B G G O W R Y O B G R O R B O Y G R B Y Y O W O G O W Y B W B R W B B O R Y R GROWBOBGROW Sample Output O O O Y Y Y R R R Y Y Y G G G B Y O W W W O O O R R R B B B G G G B Y O B B B W W W R R R W W W G G G B Y O =================================== W G R Y B G B R G B O W O R B R W R G W B G O R G R R Y B B O G O Y Y B G W R Y Y Y W W O G O W O Y B Y W O ===================================

Problem Description Dear Contestant, I'm going to have a party at my villa at Hali-Bula to celebrate my retirement from BCM. I wish I could invite all my co-workers, but imagine how an employee can enjoy a party when he finds his boss among the guests! So, I decide not to invite both an employee and his/her boss. The organizational hierarchy at BCM is such that nobody has more than one boss, and there is one and only one employee with no boss at all (the Big Boss)! Can I ask you to please write a program to determine the maximum number of guests so that no employee is invited when his/her boss is invited too? I've attached the list of employees and the organizational hierarchy of BCM. Best, --Brian Bennett P.S. I would be very grateful if your program can indicate whether the list of people is uniquely determined if I choose to invite the maximum number of guests with that condition. Input The input consists of multiple test cases. Each test case is started with a line containing an integer n (1 ≤ n ≤ 200), the number of BCM employees. The next line contains the name of the Big Boss only. Each of the following n-1 lines contains the name of an employee together with the name of his/her boss. All names are strings of at least one and at most 100 letters and are separated by blanks. The last line of each test case contains a single 0. Output For each test case, write a single line containing a number indicating the maximum number of guests that can be invited according to the required condition, and a word Yes or No, depending on whether the list of guests is unique in that case. Sample Input 6 Jason Jack Jason Joe Jack Jill Jason John Jack Jim Jill 2 Ming Cho Ming 0 Sample Output 4 Yes 1 No

eclipse 4.10.0版本的版本代号是什么？求解

C语言进行成绩转换问题

Problem Description 输入一个百分制的成绩t，将其转换成对应的等级，具体转换规则如下： 90~100为A; 80~89为B; 70~79为C; 60~69为D; 0~59为E; Input 输入数据有多组，每组占一行，由一个整数组成。 Output 对于每组输入数据，输出一行。如果输入数据不在0~100范围内，请输出一行：“Score is error!”。 Sample Input 56 67 100 123 Sample Output E D A Score is error!

C语言编程：商家商品销售量统计

c语言简单学生查询问题

![输入q类型不一样，出问题](https://img-ask.csdn.net/upload/201706/19/1497834160_477104.png) ``` #include <stdio.h> #include <string.h> #define NUMBER 5 //学生人数 //1).编写函数average，对n个学生的成绩score，计算平均分数，并返回其值。 int arevage(int score[]) { int total=0; int i=0; for (i=0;i<NUMBER;i++) { total+=score[i]; //总学生成绩 } return total/NUMBER; //得出平均值 } //2).编写函数grade，对n个学生的成绩score，分别统计及格人数c1和不及格的人数c2，并输出。 int grade(int score[]) { int c1=0;//及格人数 int c2=0;//不及格人数 int i=0; for (i=0;i<NUMBER;i++) { if(score[i]>60) c1++; else c2++; } printf ("及格人数为： %d 人\n",c1); printf ("不及格人数为： %d 人\n",c2); } //3).编写函数max，求n个学生的成绩score的最高分，并返回其值。 int max(int score[]) { int i=0,j=0; int _max=0; for (i=0;i<NUMBER-1;i++) { for(j=i+1;j<NUMBER;j++) { if(score[i]>score[j]) { _max=score[i]; score[i]=score[j]; score[j]=_max; } } } return score[i]; } //4)、编写函数xx，对n个学生的成绩score进行排序，并输出。 int xx(int score[]) { int i=0,j=0; int _max=0; for (i=0;i<NUMBER-1;i++) { for(j=i+1;j<NUMBER;j++) { if(score[i]>score[j]) { _max=score[i]; score[i]=score[j]; score[j]=_max; } } } return 0; } /*5.)编写主函数main，通过键盘输入用户的选择步骤完成相应功能，用户输入1时调用average统计平均分，输入2时调用grade统计及格或不及格人数，输入3时调用max找最大值，输入4时调用xx对成绩排序，输入0时返回。 程序要求：合适繁荣提示语 */ int menu(int _getNumber) { int new; int i=(int)_getNumber; int studentScore[NUMBER]={10,70,61,90,100}; if(i=='q'||i=='Q') { exit(1); } while(i!=1&&i!=2&&i!=3&&i!=4) { printf ("\$error :输入有误请重新输入！\a\n"); scanf("%d",&i); printf ("hello word !\n"); //scanf("%d",&i); } while(i==1||i==2||i==3||i==4) { //计算机平均分 if (i==1) { printf ("平均成绩是：%d\n",arevage(studentScore)); //continue; } //统计合格与不合格的人数 if (i==2) { grade(studentScore); //continue; } //最高成绩 if (i==3) { printf ("最高的成绩为： %d\n",max(studentScore)); } //从小到大排序 if (i==4) { xx(studentScore); for (i=0;i<NUMBER;i++) { printf ("从小到大排序后为：sutdent[%d] = %d\n",i,studentScore[i]); } } printf ("\$请再输入查询代号:"); scanf("%d",&i); if(i!=1&&i!=2&&i!=3&&i!=4) { printf ("\$error :输入有误请重新输入！\a\n"); if(scanf("%d",&i)); } if(i=='q'&&i=='Q') { break; } //printf("i = %d",i); if(i!=1&&i!=2&&i!=3&&i!=4) { printf ("\$error :输入有误请重新输入！\a\n"); scanf("%d",&i); } } } int main(int argc,char *argv[]) { int getNumber=0; printf ("***************************************************\n\n"); printf (" 输入 【1】————————统计学生成绩\n"); printf (" 输入 【2】————————分别统计学生成绩及格人数和不及格的人数\n "); printf ("输入 【3】————————统计学生的最高成绩\n "); printf ("输入 【4】————————对学生成绩进行排序\n "); printf ("输入 【q】或者【Q】————————退出程序\n "); printf ("\$你输入查询代号:"); scanf("%d",&getNumber); menu(getNumber); return 0; } ``` 主要是：让用户输入q,或者Q退出程序，输入1-4，输入其他报错，让用户重新输入 我调试了下是，当输入英文时，但scanf要求输入 整数类型，类型不一，里面的值不是本身的值，如何解决这个问题？

NullPointer代号为One

<div class="post-text" itemprop="text"> <p>i have some problems with my code with the plugin codename one it tell me that there's a nullpointer exception but the same code work in some other computers so i don't really know where come the problem exact</p> <pre><code> Form hi = new Form("Hi World"); SpanLabel sp = new SpanLabel(); hi.add(sp); hi.show(); ConnectionRequest con = new ConnectionRequest(); con.setUrl("http://localhost/pidev2017/select.php"); con.addResponseListener(new ActionListener&lt;NetworkEvent&gt;() { @Override public void actionPerformed(NetworkEvent evt) { System.out.println(getListEtudiant(new String(con.getResponseData()))); sp.setText(getListEtudiant(new String(con.getResponseData())) + ""); hi.refreshTheme(); } }); NetworkManager.getInstance().addToQueue(con); } public ArrayList&lt;Etudiant&gt; getListEtudiant(String json) { ArrayList&lt;Etudiant&gt; listEtudiants = new ArrayList&lt;&gt;(); try { JSONParser j = new JSONParser(); Map&lt;String, Object&gt; etudiants = j.parseJSON(new CharArrayReader(json.toCharArray())); System.out.println(); List&lt;Map&lt;String, Object&gt;&gt; list = (List&lt;Map&lt;String, Object&gt;&gt;) etudiants.get("etudiant"); for (Map&lt;String, Object&gt; obj : list) { Etudiant e = new Etudiant(); e.setAge(Integer.parseInt(obj.get("age").toString())); e.setCin(obj.get("cin").toString()); e.setNom(obj.get("nom").toString()); listEtudiants.add(e); } } catch (IOException ex) { } return listEtudiants; } </code></pre> <p>this is the error i get </p> <p>java.lang.NullPointerException [EDT] 0:0:0,2 - Expected null for key value while parsing JSON token at row: 2 column: 72 buffer: e1elxde-exe-dlde1ell [EDT] 0:0:0,2 - Expected null for key value while parsing JSON token at row: 2 column: 85 buffer: e1elxde-exe-dlde1ell0elldd [EDT] 0:0:0,2 - Expected true for key value while parsing JSON token at row: 3 column: 2 buffer: e1elxde-exe-dlde1ell0elldd1 [EDT] 0:0:0,2 - Expected true for key value while parsing JSON token at row: 3 column: 3 buffer: e1elxde-exe-dlde1ell0elldd1 [EDT] 0:0:0,2 - Expected null for key value while parsing JSON token at row: 3 column: 7 buffer: e1elxde-exe-dlde1ell0elldd1l [EDT] 0:0:0,2 - Expected true for key value while parsing JSON token at row: 3 column: 10 buffer: e1elxde-exe-dlde1ell0elldd1lef [EDT] 0:0:0,2 - Expected null for key value while parsing JSON token at row: 3 column: 34 buffer: e1elxde-exe-dlde1ell0elldd1leflf57900l</p> <pre><code>at com.mycompany.myapp.MyApplication.getListEtudiant(MyApplication.java:80) at com.mycompany.myapp.MyApplication\$1.actionPerformed(MyApplication.java:59) at com.mycompany.myapp.MyApplication\$1.actionPerformed(MyApplication.java:55) at com.codename1.ui.util.EventDispatcher.fireActionSync(EventDispatcher.java:459) at com.codename1.ui.util.EventDispatcher.access\$100(EventDispatcher.java:45) at com.codename1.ui.util.EventDispatcher\$CallbackClass.run(EventDispatcher.java:95) at com.codename1.ui.Display.processSerialCalls(Display.java:1152) at com.codename1.ui.Display.edtLoopImpl(Display.java:1096) at com.codename1.ui.Display.mainEDTLoop(Display.java:997) at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120) at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176) </code></pre> </div>

Golang的股票代号和守护程序

<div class="post-text" itemprop="text"> <p>Is it possible to use Ticker to implemented the graceful termination of a long running daemon process? I read the other related thread on <a href="https://stackoverflow.com/questions/17797754/ticker-stop-behaviour-in-golang">here</a> that you should always close the channel to avoid memory leak, but if I run this in a daemon mode (let said I use <a href="http://software.clapper.org/daemonize/" rel="nofollow noreferrer">daemonize</a> to handle the daemon operation outside of golang), and there's really no way for it to do any collective cleanup before the process is terminated. Unless I'm missing something, I'm here to ask whether there's an alternative/better to do this in Golang</p> <pre><code>func main() { ticker := time.NewTicker(Interval) workers := make(chan bool, 1) for t := range ticker.C { select { case &lt;- ticker.C: log.Println("Scheduled task is triggered.", t) go runWorker(workers) case &lt;- workers: log.Println("Scheduled task is completed.") // can't return, it needs to be continue running } } } </code></pre> </div>

js 根据下拉框选项随机生成代号（希望给个完整代码）

Java基础知识面试题（2020最新版）

String s = new String(" a ") 到底产生几个对象？

Linux面试题（2020最新版）

Linux命令学习神器！命令看不懂直接给你解释！

loonggg读完需要3分钟速读仅需 1 分钟大家好，我是你们的校长。我之前讲过，这年头，只要肯动脑，肯行动，程序员凭借自己的技术，赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

85后蒋凡：28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门，他的人生底层逻辑是什么？...

MySQL数据库面试题（2020最新版）