pingfang sc medium怎么引入项目

设计师的字体是用了pingfang sc medium,怎么才能引入这个字体,达到设置稿一致?

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
pyspark sc.textFile 转为的RDD 再生成 dataframe 问题
首先 我用的是spark 1.5.1 所以 网上的 spark.read.csv 等方法对我来说并不适用 这是我的配置 ![图片说明](https://img-ask.csdn.net/upload/202002/05/1580873768_746424.png) 然后 我不能解决的问题是 在pyspark 中 由 sc.textFile转换的RDD 再生成 dataframe 接下来是我的代码: (数据有54列) df=sc.textFile("file:///home/hu/births_train.csv") # 删除了第一行 import pyspark.sql.types as typ lable=[("INFANT_ALIVE_AT_REPORT",typ.StringType()),("BIRTH_YEAR",typ.IntegerType()),\ ("BIRTH_MONTH",typ.IntegerType()),( "BIRTH_PLACE",typ.StringType()),\ ("MOTHER_AGE_YEARS",typ.IntegerType()),( "MOTHER_RACE_6CODE",typ.StringType()),\ ("MOTHER_EDUCATION",typ.StringType()),( "FATHER_COMBINED_AGE",typ.IntegerType()),\ ("FATHER_EDUCATION",typ.StringType()),( "MONTH_PRECARE_RECODE",typ.StringType()),\ ("CIG_BEFORE",typ.StringType()),( "CIG_1_TRI",typ.StringType()),\ ("CIG_2_TRI",typ.StringType()),( "CIG_3_TRI",typ.StringType()),\ ("MOTHER_HEIGHT_IN",typ.StringType()),( "MOTHER_BMI_RECODE",typ.StringType()),\ ("MOTHER_PRE_WEIGHT",typ.IntegerType()),( "MOTHER_DELIVERY_WEIGHT",typ.IntegerType()),\ ("MOTHER_WEIGHT_GAIN",typ.IntegerType()),( "DIABETES_PRE",typ.StringType()),\ ("DIABETES_GEST",typ.StringType()),( "HYP_TENS_PRE",typ.StringType()),\ ("HYP_TENS_GEST",typ.StringType()),( "PREV_BIRTH_PRETERM",typ.StringType()),\ ("NO_RISK",typ.StringType()),( "NO_INFECTIONS_REPORTED",typ.StringType()),\ ("LABOR_IND",typ.StringType()),( "LABOR_AUGM",typ.StringType()),\ ( "STEROIDS",typ.StringType()),( "ANTIBIOTICS",typ.StringType()),\ ( "ANESTHESIA",typ.StringType()),( "DELIV_METHOD_RECODE_COMB",typ.StringType()),\ ( "ATTENDANT_BIRTH",typ.StringType()),( "APGAR_5",typ.StringType()),\ ( "APGAR_5_RECODE",typ.StringType()),( "APGAR_10",typ.StringType()),\ ( "APGAR_10_RECODE",typ.StringType()),( "INFANT_SEX",typ.StringType()),\ ( "OBSTETRIC_GESTATION_WEEKS",typ.StringType()),( "INFANT_WEIGHT_GRAMS",typ.StringType()),\ ( "INFANT_ASSIST_VENTI",typ.StringType()),( "INFANT_ASSIST_VENTI_6HRS",typ.StringType()),\ ( "INFANT_NICU_ADMISSION",typ.StringType()),( "INFANT_SURFACANT",typ.StringType()),\ ( "INFANT_ANTIBIOTICS",typ.StringType()),( "INFANT_SEIZURES",typ.StringType()),\ ( "INFANT_NO_ABNORMALITIES",typ.StringType()),( "INFANT_ANCEPHALY",typ.StringType()),\ ( "INFANT_MENINGOMYELOCELE",typ.StringType()),( "INFANT_LIMB_REDUCTION",typ.StringType()),\ ( "INFANT_DOWN_SYNDROME",typ.StringType()),( "INFANT_SUSPECTED_CHROMOSOMAL_DISORDER",typ.StringType()),\ ( "INFANT_NO_CONGENITAL_ANOMALIES_CHECKED",typ.StringType()),( "INFANT_BREASTFED",typ.StringType())] schema=typ.StructType([typ.StructField(e[0],e[1],False ) for e in lable]) from pyspark.sql import Row df1= df.map(lambda p : Row(p(0), p(1), p(2), p(3), p(4), p(5), p(6), p(7), p(8), p(9), p(10), p(11), p(12), p(13), p(14), p(15), p(16), p(17), p(18), p(19), p(20), p(21), p(22), p(23), p(24), p(25), p(26), p(27), p(28), p(29), p(30), p(31),p(32), p(33), p(34), p(35), p(36), p(37), p(38), p(39), p(40), p(41),p(42), p(43), p(44), p(45), p(46), p(47), p(48), p(49), p(50), p(51),p(52), p(53))) births=sqlContext.createDataFrame(df1,schema) 但是报错了 ,报错的图片如下 ![图片说明](https://img-ask.csdn.net/upload/202002/05/1580874372_282432.png) 所以这该怎么解决呢 ?? 谢谢
初学java,写了个求质数的一个文件,请大佬帮我看下对不对
想表达的是输入一个数字,看这个数字是不是质数,并输出相应结果。 另外还想问一下有没有更加简便的方法 ``` Scanner sc = new Scanner(System.in); int num = sc.nextInt(); if(num==1) { System.out.println("这不是质数"); return; } for(int i = 2;i <= num;i++) { if(num%i==0&&num!=i) { System.out.println("这不是质数"); break; } if(num==i){ System.out.println("这是质数"); } } ```
要查询选修“access”课程的年龄不小于20的全体学生姓名的sql语句是 select sname from s,c,sc where子句。这里的where子句的内容是( )。
有关系s(s#,sname,sage),c(c#,cname),sc(s#,c#,grade)。其中s#是学生号,sname是学生姓名,sage是学生年龄, c#是课程号,cname是课程名称。要查询选修“access”课程的年龄不小于20的全体学生姓名的sql语句是 select sname from s,c,sc where子句。这里的where子句的内容是( )。 a.s.s# = sc.s# and c.c# = sc.c# and sage>=20 and cname=‘access’ b.s.s# = sc.s# and c.c# = sc.c# and sage in>=20 and cname in ‘access’ c.sage in>=20 and cname in ‘access’ d.sage>=20 and cname=’ access’
SQL语句如何执行的(student学生表与SC成绩表)
Student 是学生表;SC是学生成绩表。 如Stuent表数据如下: S# Sname Sage Ssex 01 赵雷 1990-01-01 00:00:00.000 男 02 钱电 1990-12-21 00:00:00.000 男 03 孙风 1990-05-20 00:00:00.000 男 04 李云 1990-08-06 00:00:00.000 男 05 周梅 1991-12-01 00:00:00.000 女 06 吴兰 1992-03-01 00:00:00.000 女 07 郑竹 1989-07-01 00:00:00.000 女 08 王菊 1990-01-20 00:00:00.000 女 SC表数据如下: S# C# Score (其中C#表示某一课程编号) 01 01 80.0 01 02 90.0 01 03 99.0 02 01 70.0 02 02 60.0 02 03 80.0 03 01 80.0 03 02 80.0 03 03 80.0 04 01 50.0 04 02 30.0 04 03 20.0 05 01 76.0 05 02 87.0 06 01 31.0 06 03 34.0 07 02 89.0 07 03 98.0 我想知道下面的SQL语句是如何执行的? select s.*,sc1.Score [课程'01'分数],sc2.Score [课程'02'分数]from dbo.Student s, SC sc1, SC sc2 where s.S#=sc1.S# and s.S#=sc2.S# and sc1.C#='01' and sc2.C#='02' and sc1.Score > sc2.Score 到底是下面哪种执行步骤呢?它们三者之间有什么不同吗,会产生什么不同的结果? 可能执行步骤一: 1. 把stuent、sc1、sc2按S#依次内连接 2. 在Step1中得到的一张大表进行筛选,符合sc1.C#='01' and sc2.C#='02'条件的筛选出来,得到最终结果 可能执行步骤二: 1. 把sc1中的数据按sc1.C#='01'先筛选出符合条件的记录,得到一张结果表如A 2. 把sc2中的数据按sc2.C#='02'先筛选出符合条件的记录,得到一张结果表如B 3. 再把stuent、step1中的A表、step2中的B表按s#内连接,得到最终的结果 可能执行步骤三: 1. 将student、sc1按s#及sc1.C#='01'的条件进行内连接,得到结果A 2. 将step中的结果A与sc2按s#及sc2.C#='02'的条件进行内连接,得到最终的结果 即类似于下面的执行SQL语句: select a.*,b.Score[课程'01'分数],c.Score[课程'02'分数] from Student a join SC b on a.S#=b.S# and b.C#='01' join SC c on a.S#=c.S# and c.C#='02' where b.Score < c.Score 谁能告诉我,到底是按哪种方式进行连接的,这三种方式有什么区别?
字符串对称判断 。StringBuilder 转换成 String后地址不同么?但是内容相同,应该是同一个常量池的地址啊。
public static void main(String[] args) { //A:键盘输入一个字符串 Scanner sc=new Scanner(System.in); String s=sc.nextLine(); panduan(s); } public static void panduan(String s) { StringBuilder sb=new StringBuilder(s); String ss=sb.reverse().toString(); System.out.println(ss); if(ss==s) { System.out.println("是对称字符串"); }else { System.out.println("不是对称字符串"); } } ![图片说明](https://img-ask.csdn.net/upload/202002/04/1580794148_424621.png) 不管输入是否为对称字符串,都是不对称。
sc config 命令中password 设置无效
通过以下命令,设置ServerName的启动用户名 sc config ServerName obj= userName password= passwordInfo type= own 重新启动服务器,提示10057错误(用户名或密码错误),而可以确认的 是用户名与密码是正确的。(PS:通过此命令,密码错误也可设置成功) 而通过services.msc的服务属性 -> 登录 指定相同的用户名与密码后,可正常 使用指定的用户名启动服务。 问:通过sc config 指定用户名与密码还有什么需要指定的吗? 还有什么方法可以通过命令行的方式指定NT服务的启用用户名,谢谢!
tensorflow 报错You must feed a value for placeholder tensor 'Placeholder_1' with dtype float and shape [?,32,32,3],但是怎么看数据都没错,请大神指点
调试googlenet的代码,总是报错 InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'Placeholder_1' with dtype float and shape [?,32,32,3],但是我怎么看喂的数据都没问题,请大神们指点 ``` # -*- coding: utf-8 -*- """ GoogleNet也被称为InceptionNet Created on Mon Feb 10 12:15:35 2020 @author: 月光下的云海 """ import tensorflow as tf from keras.datasets import cifar10 import numpy as np import tensorflow.contrib.slim as slim tf.reset_default_graph() tf.reset_default_graph() (x_train,y_train),(x_test,y_test) = cifar10.load_data() x_train = x_train.astype('float32') x_test = x_test.astype('float32') y_train = y_train.astype('int32') y_test = y_test.astype('int32') y_train = y_train.reshape(y_train.shape[0]) y_test = y_test.reshape(y_test.shape[0]) x_train = x_train/255 x_test = x_test/255 #************************************************ 构建inception ************************************************ #构建一个多分支的网络结构 #INPUTS: # d0_1:最左边的分支,分支0,大小为1*1的卷积核个数 # d1_1:左数第二个分支,分支1,大小为1*1的卷积核的个数 # d1_3:左数第二个分支,分支1,大小为3*3的卷积核的个数 # d2_1:左数第三个分支,分支2,大小为1*1的卷积核的个数 # d2_5:左数第三个分支,分支2,大小为5*5的卷积核的个数 # d3_1:左数第四个分支,分支3,大小为1*1的卷积核的个数 # scope:参数域名称 # reuse:是否重复使用 #*************************************************************************************************************** def inception(x,d0_1,d1_1,d1_3,d2_1,d2_5,d3_1,scope = 'inception',reuse = None): with tf.variable_scope(scope,reuse = reuse): #slim.conv2d,slim.max_pool2d的默认参数都放在了slim的参数域里面 with slim.arg_scope([slim.conv2d,slim.max_pool2d],stride = 1,padding = 'SAME'): #第一个分支 with tf.variable_scope('branch0'): branch_0 = slim.conv2d(x,d0_1,[1,1],scope = 'conv_1x1') #第二个分支 with tf.variable_scope('branch1'): branch_1 = slim.conv2d(x,d1_1,[1,1],scope = 'conv_1x1') branch_1 = slim.conv2d(branch_1,d1_3,[3,3],scope = 'conv_3x3') #第三个分支 with tf.variable_scope('branch2'): branch_2 = slim.conv2d(x,d2_1,[1,1],scope = 'conv_1x1') branch_2 = slim.conv2d(branch_2,d2_5,[5,5],scope = 'conv_5x5') #第四个分支 with tf.variable_scope('branch3'): branch_3 = slim.max_pool2d(x,[3,3],scope = 'max_pool') branch_3 = slim.conv2d(branch_3,d3_1,[1,1],scope = 'conv_1x1') #连接 net = tf.concat([branch_0,branch_1,branch_2,branch_3],axis = -1) return net #*************************************** 使用inception构建GoogleNet ********************************************* #使用inception构建GoogleNet #INPUTS: # inputs-----------输入 # num_classes------输出类别数目 # is_trainning-----batch_norm层是否使用训练模式,batch_norm和is_trainning密切相关 # 当is_trainning = True 时候,它使用一个batch数据的平均移动,方差值 # 当is_trainning = Flase时候,它就使用固定的值 # verbos-----------控制打印信息 # reuse------------是否重复使用 #*************************************************************************************************************** def googlenet(inputs,num_classes,reuse = None,is_trainning = None,verbose = False): with slim.arg_scope([slim.batch_norm],is_training = is_trainning): with slim.arg_scope([slim.conv2d,slim.max_pool2d,slim.avg_pool2d], padding = 'SAME',stride = 1): net = inputs #googlnet的第一个块 with tf.variable_scope('block1',reuse = reuse): net = slim.conv2d(net,64,[5,5],stride = 2,scope = 'conv_5x5') if verbose: print('block1 output:{}'.format(net.shape)) #googlenet的第二个块 with tf.variable_scope('block2',reuse = reuse): net = slim.conv2d(net,64,[1,1],scope = 'conv_1x1') net = slim.conv2d(net,192,[3,3],scope = 'conv_3x3') net = slim.max_pool2d(net,[3,3],stride = 2,scope = 'max_pool') if verbose: print('block2 output:{}'.format(net.shape)) #googlenet第三个块 with tf.variable_scope('block3',reuse = reuse): net = inception(net,64,96,128,16,32,32,scope = 'inception_1') net = inception(net,128,128,192,32,96,64,scope = 'inception_2') net = slim.max_pool2d(net,[3,3],stride = 2,scope = 'max_pool') if verbose: print('block3 output:{}'.format(net.shape)) #googlenet第四个块 with tf.variable_scope('block4',reuse = reuse): net = inception(net,192,96,208,16,48,64,scope = 'inception_1') net = inception(net,160,112,224,24,64,64,scope = 'inception_2') net = inception(net,128,128,256,24,64,64,scope = 'inception_3') net = inception(net,112,144,288,24,64,64,scope = 'inception_4') net = inception(net,256,160,320,32,128,128,scope = 'inception_5') net = slim.max_pool2d(net,[3,3],stride = 2,scope = 'max_pool') if verbose: print('block4 output:{}'.format(net.shape)) #googlenet第五个块 with tf.variable_scope('block5',reuse = reuse): net = inception(net,256,160,320,32,128,128,scope = 'inception1') net = inception(net,384,182,384,48,128,128,scope = 'inception2') net = slim.avg_pool2d(net,[2,2],stride = 2,scope = 'avg_pool') if verbose: print('block5 output:{}'.format(net.shape)) #最后一块 with tf.variable_scope('classification',reuse = reuse): net = slim.flatten(net) net = slim.fully_connected(net,num_classes,activation_fn = None,normalizer_fn = None,scope = 'logit') if verbose: print('classification output:{}'.format(net.shape)) return net #给卷积层设置默认的激活函数和batch_norm with slim.arg_scope([slim.conv2d],activation_fn = tf.nn.relu,normalizer_fn = slim.batch_norm) as sc: conv_scope = sc is_trainning_ph = tf.placeholder(tf.bool,name = 'is_trainning') #定义占位符 x_train_ph = tf.placeholder(shape = (None,x_train.shape[1],x_train.shape[2],x_train.shape[3]),dtype = tf.float32) x_test_ph = tf.placeholder(shape = (None,x_test.shape[1],x_test.shape[2],x_test.shape[3]),dtype = tf.float32) y_train_ph = tf.placeholder(shape = (None,),dtype = tf.int32) y_test_ph = tf.placeholder(shape = (None,),dtype = tf.int32) #实例化网络 with slim.arg_scope(conv_scope): train_out = googlenet(x_train_ph,10,is_trainning = is_trainning_ph,verbose = True) val_out = googlenet(x_test_ph,10,is_trainning = is_trainning_ph,reuse = True) #定义loss和acc with tf.variable_scope('loss'): train_loss = tf.losses.sparse_softmax_cross_entropy(labels = y_train_ph,logits = train_out,scope = 'train') val_loss = tf.losses.sparse_softmax_cross_entropy(labels = y_test_ph,logits = val_out,scope = 'val') with tf.name_scope('accurcay'): train_acc = tf.reduce_mean(tf.cast(tf.equal(tf.argmax(train_out,axis = -1,output_type = tf.int32),y_train_ph),tf.float32)) val_acc = tf.reduce_mean(tf.cast(tf.equal(tf.argmax(val_out,axis = -1,output_type = tf.int32),y_test_ph),tf.float32)) #定义训练op lr = 1e-2 opt = tf.train.MomentumOptimizer(lr,momentum = 0.9) #通过tf.get_collection获得所有需要更新的op update_op = tf.get_collection(tf.GraphKeys.UPDATE_OPS) #使用tesorflow控制流,先执行update_op再进行loss最小化 with tf.control_dependencies(update_op): train_op = opt.minimize(train_loss) #开启会话 sess = tf.Session() saver = tf.train.Saver() sess.run(tf.global_variables_initializer()) batch_size = 64 #开始训练 for e in range(10000): batch1 = np.random.randint(0,50000,size = batch_size) t_x_train = x_train[batch1][:][:][:] t_y_train = y_train[batch1] batch2 = np.random.randint(0,10000,size = batch_size) t_x_test = x_test[batch2][:][:][:] t_y_test = y_test[batch2] sess.run(train_op,feed_dict = {x_train_ph:t_x_train, is_trainning_ph:True, y_train_ph:t_y_train}) # if(e%1000 == 999): # loss_train,acc_train = sess.run([train_loss,train_acc], # feed_dict = {x_train_ph:t_x_train, # is_trainning_ph:True, # y_train_ph:t_y_train}) # loss_test,acc_test = sess.run([val_loss,val_acc], # feed_dict = {x_test_ph:t_x_test, # is_trainning_ph:False, # y_test_ph:t_y_test}) # print('STEP{}:train_loss:{:.6f} train_acc:{:.6f} test_loss:{:.6f} test_acc:{:.6f}' # .format(e+1,loss_train,acc_train,loss_test,acc_test)) saver.save(sess = sess,save_path = 'VGGModel\model.ckpt') print('Train Done!!') print('--'*60) sess.close() ``` 报错信息是 ``` Using TensorFlow backend. block1 output:(?, 16, 16, 64) block2 output:(?, 8, 8, 192) block3 output:(?, 4, 4, 480) block4 output:(?, 2, 2, 832) block5 output:(?, 1, 1, 1024) classification output:(?, 10) Traceback (most recent call last): File "<ipython-input-1-6385a760fe16>", line 1, in <module> runfile('F:/Project/TEMP/LearnTF/GoogleNet/GoogleNet.py', wdir='F:/Project/TEMP/LearnTF/GoogleNet') File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace) File "F:/Project/TEMP/LearnTF/GoogleNet/GoogleNet.py", line 177, in <module> y_train_ph:t_y_train}) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\tensorflow\python\client\session.py", line 900, in run run_metadata_ptr) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\tensorflow\python\client\session.py", line 1135, in _run feed_dict_tensor, options, run_metadata) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\tensorflow\python\client\session.py", line 1316, in _do_run run_metadata) File "D:\ANACONDA\Anaconda3\envs\spyder\lib\site-packages\tensorflow\python\client\session.py", line 1335, in _do_call raise type(e)(node_def, op, message) InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder_1' with dtype float and shape [?,32,32,3] [[Node: Placeholder_1 = Placeholder[dtype=DT_FLOAT, shape=[?,32,32,3], _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]] [[Node: gradients/block4/inception_4/concat_grad/ShapeN/_45 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device_incarnation=1, tensor_name="edge_23694_gradients/block4/inception_4/concat_grad/ShapeN", tensor_type=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]] ``` 看了好多遍都不是喂数据的问题,百度说是summary出了问题,可是我也没有summary呀,头晕~~~~
Hiking Trip 的编写
Problem Description Hiking in the mountains is seldom an easy task for most people, as it is extremely easy to get lost during the trip. Recently Green has decided to go on a hiking trip. Unfortunately, half way through the trip, he gets extremely tired and so needs to find the path that will bring him to the destination with the least amount of time. Can you help him? You've obtained the area Green's in as an R * C map. Each grid in the map can be one of the four types: tree, sand, path, and stone. All grids not containing stone are passable, and each time, when Green enters a grid of type X (where X can be tree, sand or path), he will spend time T(X). Furthermore, each time Green can only move up, down, left, or right, provided that the adjacent grid in that direction exists. Given Green's current position and his destination, please determine the best path for him. Input There are multiple test cases in the input file. Each test case starts with two integers R, C (2 <= R <= 20, 2 <= C <= 20), the number of rows / columns describing the area. The next line contains three integers, VP, VS, VT (1 <= VP <= 100, 1 <= VS <= 100, 1 <= VT <= 100), denoting the amount of time it requires to walk through the three types of area (path, sand, or tree). The following R lines describe the area. Each of the R lines contains exactly C characters, each character being one of the following: ‘T’, ‘.’, ‘#’, ‘@’, corresponding to grids of type tree, sand, path and stone. The final line contains four integers, SR, SC, TR, TC, (0 <= SR < R, 0 <= SC < C, 0 <= TR < R, 0 <= TC < C), representing your current position and your destination. It is guaranteed that Green's current position is reachable – that is to say, it won't be a '@' square. There is a blank line after each test case. Input ends with End-of-File. Output For each test case, output one integer on one separate line, representing the minimum amount of time needed to complete the trip. If there is no way for Green to reach the destination, output -1 instead. Sample Input 4 6 1 2 10 T...TT TTT### TT.@#T ..###@ 0 1 3 0 4 6 1 2 2 T...TT TTT### TT.@#T ..###@ 0 1 3 0 2 2 5 1 3 T@ @. 0 0 1 1 Sample Output Case 1: 14 Case 2: 8 Case 3: -1
走日字棋盘 递归算法 布尔类型 怎么返回上一层
#include <iostream> using namespace std; bool can_reach(int start_c, int start_r, int finish_c, int finish_r, int num_moves) { if (num_moves == 0) { if ((start_c == finish_r) && (start_r == finish_r)) { //cout << "same point" << endl; return true; } //else { // cout << "no" << endl; // return false; //} } else { if ((start_c > 7 || start_c < 0) || (start_r > 7 || start_r < 0)) { return false; } //if (num_moves < 0) { // return 0; //} switch (1) { case 1:return can_reach(start_c + 2, start_r + 1, finish_c, finish_r, num_moves--); case 2:return can_reach(start_c + 2, start_r - 1, finish_c, finish_r, num_moves--); case 3:return can_reach(start_c + 1, start_r + 2, finish_c, finish_r, num_moves--); case 4:return can_reach(start_c + 1, start_r - 2, finish_c, finish_r, num_moves--); case 5:return can_reach(start_c - 2, start_r + 1, finish_c, finish_r, num_moves--); case 6:return can_reach(start_c - 2, start_r - 1, finish_c, finish_r, num_moves--); case 7:return can_reach(start_c - 1, start_r + 2, finish_c, finish_r, num_moves--); case 8:return can_reach(start_c - 1, start_r - 2, finish_c, finish_r, num_moves--); } //if (start_c == finish_c) { // if (start_r = finish_r) { // cout << num_moves << endl; // return true; // } //} else { // return false; //} } } int main() { //int board[8][8]; int start_c, start_r, finish_c, finish_r, num_moves; cout << "enter sc" << endl; cin >> start_c; if (!cin) { cout << "error" << endl; return 0; } cout << "enter sr" << endl; cin >> start_r; if (!cin) { cout << "error" << endl; return 0; } cout << "enter fc" << endl; cin >> finish_c; if (!cin) { cout << "error" << endl; return 0; } cout << "enter fr" << endl; cin >> finish_r; if (!cin) { cout << "error" << endl; return 0; } cout << "enter nm" << endl; cin >> num_moves; if (!cin) { cout << "error" << endl; return 0; } bool can_or_not = false; can_or_not=can_reach(start_c, start_r, finish_c, finish_r, num_moves); cout << can_or_not << endl; }
java.util.Scanner.throwFor(Scanner.java:937)
在eclipse里可以运行,但是放到OJ里就报错 **运行错误:** >Exception in thread "main" java.util.NoSuchElementException at java.base/java.util.Scanner.throwFor(Scanner.java:937) at java.base/java.util.Scanner.next(Scanner.java:1594) at java.base/java.util.Scanner.nextInt(Scanner.java:2258) at java.base/java.util.Scanner.nextInt(Scanner.java:2212) at Main.randomGeneratorArray(Main.java:33) at Main.main(Main.java:92) **原代码** ``` import java.util.Scanner; public class develop_1165 { public static void bubbleSort(int[] arr) { for (int i = arr.length - 1; i > 0; i--) { for (int j = 0; j < i; j++) { if (arr[j] > arr[j + 1]) { swap(arr, j, j + 1); } } } } public static void swap(int[] arr, int i, int j) { arr[i] = arr[i] ^ arr[j]; arr[j] = arr[i] ^ arr[j]; arr[i] = arr[i] ^ arr[j]; } public static void displayArray(int[] arr) { for (int i = 0; i < arr.length; i++) { System.out.print(arr[i] + " "); } } public static int[] randomGeneratorArray(int value, int size) { int[] arr = new int[size]; Scanner sc = new Scanner(System.in); for (int i = 0; i < arr.length; i++) { int k = sc.nextInt(); if (k <= value && k > 0) { arr[i] = k; } } return arr; } public static int[] againArray(int[] arr1) { int[] arr2 = copyArray(arr1); for (int i = arr1.length - 1; i > 0; i--) { for (int j = 0; j < i; j++) { if (arr1[j] == arr1[i]) { arr2 = deleteArray(arr2, i); } } } return arr2; } public static int[] deleteArray(int[] arr2, int num) { int[] arr3 = new int[arr2.length - 1]; if (num < arr2.length) { for (int i = 0; i < num; i++) { arr3[i] = arr2[i]; } for (int i = num + 1, j = num; i < arr2.length && num < arr3.length; i++, j++) { arr3[j] = arr2[i]; } } if (num <= arr2.length) { return arr2; } return arr3; } public static int[] copyArray(int[] arr1) { if (arr1 == null) { return null; } int[] arr2 = new int[arr1.length]; for (int i = 0; i < arr1.length; i++) { arr2[i] = arr1[i]; } return arr2; } public static void main (String[] args) { Scanner scan = new Scanner(System.in); int i = scan.nextInt(); int value = 1000; int size; if (i > 0 && i <= 100) { size = i; int[] arr1 = randomGeneratorArray(value, size); System.out.println(); int[] arr2 = againArray(arr1); bubbleSort(arr2); System.out.println(arr2.length); displayArray(arr2); } } ```
SQL server 查询“c001”课程比“c002”课程成绩高的所有学生的学号
查询“c001”课程比“c002”课程成绩高的所有学生的学号 create table sc( sno varchar(10), cno varchar(10), score int constraint pk_sc primary key (sno,cno) ); create table student( sno varchar(10) primary key, sname varchar(20), sage tinyint, ssex varchar(5) ); /*****************初始化成绩表 insert into sc values ('s001','c001',78.9); insert into sc values ('s002','c001',80.9); insert into sc values ('s003','c001',81.9); insert into sc values ('s004','c001',60.9); insert into sc values ('s001','c002',82.9); insert into sc values ('s002','c002',72.9); insert into sc values ('s003','c002',81.9); insert into sc values ('s001','c003','59'); /*******初始化学生表的数据******/ insert into student values ('s001','张三',23,'男'); insert into student values ('s002','李四',23,'男'); insert into student values ('s003','吴鹏',25,'男'); insert into student values ('s004','琴沁',20,'女'); insert into student values ('s005','王丽',20,'女'); insert into student values ('s006','李波',21,'男'); insert into student values ('s007','刘玉',21,'男'); insert into student values ('s008','萧蓉',21,'女'); insert into student values ('s009','陈萧晓',23,'女'); insert into student values ('s010','陈美',22,'女');
求数组中最大的三个数
> 链接:https://ac.nowcoder.com/acm/contest/3570/A 来源:牛客网 集训队员一共n个人,HJ会为你提供每个人的编程能力值w。你需要找到编程能力值之和最大的三个人,输出他们的编程能力值之和。特别的,如果找不到一个队伍的编程能力值之和大于m,则输出"Waiver!"。 . . . 输入描述: 第一行输入一个整数n,一个整数m,中间用空格隔开。 第二行输入n个整数 . . ## 下面是我的代码 ``` import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int size = sc.nextInt(); int goal = sc.nextInt(); int[] nums = new int[size]; for (int i = 0; i < size; i++) { nums[i] = sc.nextInt(); } for(int i =0; i < size - 1; i++) { for (int j = 0; j < size- i- 1; j++) { if(nums[j] > nums[j+1]) { int temp = nums[j]; nums[j] = nums[j+1]; nums[j+1] = temp; } } } int sum = nums[size-1] + nums[size-2] + nums[size-3]; if(sum < goal) { System.out.print("Waiver!"); } else System.out.print(sum); } } ``` . . . 但是并没有通过全部的测试用例。到底是哪里有问题呢
用vs编写c#文件,sln文件和sc文件的区别
为什么sln文件有生成选项,sc文件没有生成选项?可不可以先打开sln文件再打开sc文件 这样对么?
Electronic Document Security 文档安全的问题
Problem Description The Tyrell corporation uses a state-of-the-art electronic document system that controls all aspects of document creation, viewing, editing, and distribution. Document security is handled via access control lists (ACLs). An ACL defines a set of entities that have access to the document, and for each entity defines the set of rights that it has. Entities are denoted by uppercase letters; an entity might be a single individual or an entire division. Rights are denoted by lowercase letters; examples of rights are a for append, d for delete, e for edit, and r for read. The ACL for a document is stored along with that document, but there is also a separate ACL log stored on a separate log server. All documents start with an empty ACL, which grants no rights to anyone. Every time the ACL for a document is changed, a new entry is written to the log. An entry is of the form ExR, where E is a nonempty set of entities, R is a nonempty set of rights, and x is either "+", "–", or "=". Entry E+R says to grant all the rights in R to all the entities in E, entry E–R says to remove all the rights in R from all the entities in E, and entry E=R says that all the entities in E have exactly the rights in R and no others. An entry might be redundant in the sense that it grants an entity a right it already has and/or denies an entity a right that it doesn't have. A log is simply a list of entries separated by commas, ordered chronologically from oldest to most recent. Entries are cumulative, with newer entries taking precedence over older entries if there is a conflict. Periodically the Tyrell corporation will run a security check by using the logs to compute the current ACL for each document and then comparing it with the ACL actually stored with the document. A mismatch indicates a security breach. Your job is to write a program that, given an ACL log, computes the current ACL. Input The input consists of one or more ACL logs, each 3–79 characters long and on a line by itself, followed by a line containing only "#" that signals the end of the input. Logs will be in the format defined above and will not contain any whitespace. Output For each log, output a single line containing the log number (logs are numbered sequentially starting with one), then a colon, then the current ACL in the format shown below. Note that (1) spaces do not appear in the output; (2) entities are listed in alphabetical order; (3) the rights for an entity are listed in alphabetical order; (4) entities with no current rights are not listed (even if they appeared in a log entry), so it's possible that an ACL will be empty; and (5) if two or more consecutive entities have exactly the same rights, those rights are only output once, after the list of entities. Sample Input MC-p,SC+c YB=rde,B-dq,AYM+e GQ+tju,GH-ju,AQ-z,Q=t,QG-t JBL=fwa,H+wf,LD-fz,BJ-a,P=aw # Sample Output 1:CSc 2:AeBerMeYder 3: 4:BHJfwLPaw
cmd计划任务 批处理 怎么把安全选项里面两个勾打上
计划任务用批处理创建 用户是administrator 用命令怎么把这两个勾打上 下面是我写的命令 执行之后可以创建 但是图片里面这两个勾没打上 怎么才能打上 @echo off schtasks /create /tn "自动清理" /ru administrator /tr C:\Users\Administrator.SC-201904261311\Desktop\微信多开.bat /sc onstart start %systemroot%\tasks echo 创建成功,请检查... pause del /f 新建文本文档.bat ![图片说明](https://img-ask.csdn.net/upload/201912/04/1575468013_167824.jpg)
Httpclient 请求weblogic的HttpServlet 返回的Response中Header不一致问题
大家好,开发过程中遇到个问题 ,我做的是CS项目,在客户端用Httpclient 请求weblogic的HttpServlet 返回的HttpServletResponse用了gzip压缩结果,但是在客户端接收时解压抛异常:java.util.zip.ZipException: Not in GZIP format server端设置了Header 并且压缩结果流 ``` response.setHeader("Content-Type", "text/html;charset=UTF-8"); response.setHeader("Content-Encoding", "gzip"); gzipstream = new GZIPOutputStream(output); ``` 客户端代码如下 CloseableHttpResponse response = defHttpclient.execute(httppost); ``` if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { InputStream inputStream = response.getEntity().getContent(); StringBuffer sb = new StringBuffer(); GZIPInputStream gzin = new GZIPInputStream(inputStream); InputStreamReader isr = new InputStreamReader(inputStream, charSet); String tempbf; long test3 = System.currentTimeMillis(); while ((tempbf = br.readLine()) != null) { sb.append(tempbf); } text_msg = sb.toString(); try { isr.close(); gzin.close(); inputStream.close(); } catch (Exception ex) { logger.error("class Request : when inputStream byteOut", ex); } } ``` 会在这一行报错 GZIPInputStream gzin = new GZIPInputStream(inputStream); 通过这个方法发现 Header headers[] = response.getAllHeaders(); 获得的Header中并没有服务端设置的setHeader("Content-Encoding", "gzip"); 请大佬们帮忙分析分析
帮忙看下导入导出 和排序有问题 没有 本人新手也看不出啥问题,就运行不出来 ,学生类我放在后面的。
package xuejiguanli; import jxl.*; import jxl.Workbook; import jxl.format.Colour; import jxl.format.UnderlineStyle; import jxl.format.VerticalAlignment; import jxl.read.biff.BiffException; import jxl.write.WritableSheet; import jxl.write.WritableWorkbook; import jxl.write.WriteException; import jxl.write.biff.RowsExceededException; import jxl.write.Label; import jxl.write.WritableCellFormat; import jxl.write.WritableFont; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; import java.util.Scanner; import javax.swing.GroupLayout.Alignment; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; //-------------------------------------------------------------------这是成绩管理系统的主界面 public class xueshengdei{ public static void main(String[] args) { List<Student> Students = new ArrayList<>(); while(true) { //----------------------------------------------------------------------菜单 System.out.println("-----------------学生管理系统----------------"); System.out.println("-------欢迎使用重庆工程学院学籍管理系统-------"); System.out.println("你可以使用的功能如下:^_^"); System.out.println(" 1-------------增加学生信息"); System.out.println(" 2-------------删除学生信息"); System.out.println(" 3-------------修改学生信息"); System.out.println(" 4-------------查看单独学生信息"); System.out.println(" 5-------------查看所有学生的信息"); System.out.println(" 6-------------对当前所有学生进行升序排序"); System.out.println(" 7-------------查看学校通知"); System.out.println(" 8-------------导入学生信息"); System.out.println(" 9-------------导出学生信息"); System.out.println(" 10------------退出该系统"); Scanner sc =new Scanner(System.in); System.out.println("请输入序号选择其对应的功能:"); String j = sc.nextLine(); switch (j) { case "1": //增加学生 addstudent(Students); break; case "2": //删除学生 deletestudent(Students); break; case "3": //修改学生 changestudent(Students); break; case "4": //单独查找 singlefind(Students); break; case "5": //查看所有学生 findstudent(Students); break; case "6": //排序 System.out.println("请输入你要是实现的排序功能:"); Scanner s =new Scanner(System.in); System.out.println("1---------------成绩排序:"); System.out.println("2---------------年龄排序:"); System.out.println("3---------------学号排序:"); String second=s.nextLine(); switch(second) { case "1": paixu(Students);break; case "2": paixu3(Students); break; case "3": paixu2(Students); break; } break; case "7": tongzhi(Students); //查看学校通知 break; case "8": exceldaoru(Students); //导入学生信息 break; case "9": daochu(Students); //导出学生信息 break; case "10": System.out.println("谢谢你的使用!"); System.exit(0);//退出 default: System.out.println("输入错误请重新输入!"); break; } } } //--------------------------------------------------------------导出 public static void daochu(List<Student> Students) { String excelpath; Scanner scanner=new Scanner(System.in); System.out.println("操作:导出数据"); System.out.println("请输入导出Excel文件路径:"); excelpath = scanner.next(); try { FileOutputStream fos = new FileOutputStream(excelpath); WritableWorkbook wwb = Workbook.createWorkbook(fos); // 创建工作表 WritableSheet ws = wwb.createSheet("学生学籍表", 10); // 设置单元格的文字格式 WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.NO_BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK); WritableCellFormat wcf = new WritableCellFormat(wf); wcf.setVerticalAlignment(VerticalAlignment.CENTRE); ws.setColumnView(4, 10); ws.setColumnView(5, 16); ws.setColumnView(0, 14); ws.addCell(new Label(0, 0, "学号", wcf)); ws.addCell(new Label(1, 0, "姓名", wcf)); ws.addCell(new Label(2, 0, "年龄", wcf)); ws.addCell(new Label(3, 0, "性别", wcf)); ws.addCell(new Label(4, 0, "成绩", wcf)); // 填充数据的内容 // 匹配学生学号 System.out.println("所有学生学籍信息如下:"); int cnt = 1; while (cnt <= Students.size()) { Student s = (Student) Students.get(cnt - 1); ws.addCell(new Label(4, cnt, String.valueOf(s.getId()), wcf)); ws.addCell(new Label(1, cnt, String.valueOf(s.getName()), wcf)); ws.addCell(new Label(2, cnt, String.valueOf(s.getAge()), wcf)); ws.addCell(new Label(3, cnt, String.valueOf(s.getSex()), wcf)); ws.addCell(new Label(4, cnt, String.valueOf(s.getScore()), wcf)); cnt++; if (cnt == 0) wcf = new WritableCellFormat(); } wwb.write(); wwb.close(); System.out.println("学生信息导出成功!"); } catch (IOException e) { e.printStackTrace(); } catch (RowsExceededException e) { e.printStackTrace(); } catch (WriteException e) { e.printStackTrace(); } } //---------------------------------------------------------------导入 public static void exceldaoru(List<Student> Students) { Scanner scanner=new Scanner(System.in); String excelpath; excelpath = scanner.next(); WritableWorkbook book = null; try { // 创建一个Excel文件对象 FileOutputStream fos = new FileOutputStream(excelpath); // 创建Excel第一个选项卡对象 WritableWorkbook book1 = Workbook.createWorkbook(new File(excelpath)); WritableSheet sheet = book1.createSheet("第一页", 0); // 设置表头,第一行内容 // Label参数说明:第一个是列,第二个是行,第三个是要写入的数据值,索引值都是从0开始 Label label1 = new Label(0, 0, "学号");// 对应为第1列第1行的数据 Label label2 = new Label(1, 0, "姓名");// 对应为第2列第1行的数据 Label label3 = new Label(2, 0, "年龄");// 对应为第3列第1行的数据 Label label4 = new Label(3, 0, "性别");// 对应为第4列第1行的数据 // 添加单元格到选项卡中 sheet.addCell(label1); sheet.addCell(label2); sheet.addCell(label3); sheet.addCell(label4); // 遍历集合并添加数据到行,每行对应一个对象 for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); // 表头占据第一行,所以下面行数是索引值+1 // 跟上面添加表头一样添加单元格数据,这里为了方便直接使用链式编程 sheet.addCell(new Label(0, i + 1, s.getId()+"")); sheet.addCell(new Label(1, i + 1, s.getName())); sheet.addCell(new Label(2, i + 1, s.getAge()+"")); sheet.addCell(new Label(3, i + 1, s.getSex())); sheet.addCell(new Label(4, i + 1, s.getScore()+"")); } // 写入数据到目标文件 book.write(); } catch (Exception e) { e.printStackTrace(); } finally { try { // 关闭 book.close(); } catch (Exception e) { e.printStackTrace(); } } } //----------------------------------------------------------------------------------通知 public static void tongzhi(List<Student> Students) { int index = -1; if(Students.size()==0) { System.out.println("请你输入学生后再来查看通知,谢谢!"); return; } int[] point = new int[100]; for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); point[i] = s.getScore(); } for (int i = 0; i < Students.size(); i++) { if (point[i]<60){ Student s = Students.get(i); System.out.println(s.getName()+"同学,你收到的通知如下:"); System.out.println("恭喜你挂科了"); System.out.println("恭喜你挂科了"); System.out.println("恭喜你挂科了"); System.out.println("重要的事情说三遍"); } else { Student s = Students.get(i); System.out.println(s.getName()+"同学,你收到的通知如下:"); System.out.println("哎呦不错哟"); System.out.println("恭喜你没有挂科"); } } } //-----------------------------------------------------------------------------------成绩排序 public static void paixu(List<Student> Students) { if(Students.size()==0) { System.out.println("不好意思,目前还没有学生的信息可供排序,请返回重新操作!"); return; } int[] point = new int[100]; for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); point[i] = s.getScore(); Arrays.sort(point); } for (int j = 0; j < point.length; j++) { for (int i = 0; i < Students.size(); i++) { if (point[j]==Students.get(i).getScore()){ Student s = Students.get(i); System.out.println("学号\t姓名\t年龄\t性别\t成绩"); System.out.println(s.getId()+"\t"+s.getName()+"\t"+s.getAge()+"\t"+s.getSex()+"\t"+s.getScore()); } } } } //--------------------------------------------------------------------学号排序 public static void paixu2(List<Student> Students) { if(Students.size()==0) { System.out.println("不好意思,目前还没有学生的信息可供排序,请返回重新操作!"); return; } int[] point = new int[10000000]; for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); point[i] = s.getId(); Arrays.sort(point); } for (int j = 0; j < point.length; j++) { for (int i = 0; i < Students.size(); i++) { if (point[j]==Students.get(i).getId()){ Student s = Students.get(i); System.out.println("学号\t姓名\t年龄\t性别\t成绩"); System.out.println(s.getId()+"\t"+s.getName()+"\t"+s.getAge()+"\t"+s.getSex()+"\t"+s.getScore()); } } } } //---------------------------------------------------------------------------------------年龄排序 public static void paixu3(List<Student> Students) { if(Students.size()==0) { System.out.println("不好意思,目前还没有学生的信息可供排序,请返回重新操作!"); return; } int[] point = new int[100]; for (int i = 0; i < Students.size(); i++) { Student s = Students.get(i); point[i] = s.getAge(); Arrays.sort(point); } for (int j = 0; j < point.length; j++) { for (int i = 0; i < Students.size(); i++) { if (point[j]==Students.get(i).getAge()){ Student s = Students.get(i); System.out.println("学号\t姓名\t年龄\t性别\t成绩"); System.out.println(s.getId()+"\t"+s.getName()+"\t"+s.getAge()+"\t"+s.getSex()+"\t"+s.getScore()); } } } } //-------------------------------------------------------------------------------------------添加 public static void addstudent(List<Student> Students) { //创建键盘录入对象 Scanner sc= new Scanner(System.in); while(true) { System.out.println("请输入学号:"); int id= sc.nextInt(); System.out.println("请输入姓名:"); String name = sc.nextLine(); System.out.println("请输入年龄:"); int age = sc.nextInt(); System.out.println("请输入性别:"); String sex = sc.nextLine(); System.out.println("请输入成绩:"); int score = sc.nextInt(); //创建学生对象 Student s = new Student(); s.setId(id); s.setName(name); s.setAge(age); s.setSex(sex); s.setScore(score); //把学生对象添加到集合 Students.add(s); break; } System.out.println("添加学生成功!"); } //-----------------------------------------------------------------------------------------(查找所有学生) public static void findstudent(List<Student> Students) { if(Students.size()==0) { System.out.println("不好意思,目前还没有学生的信息可供查询,请返回重新操作!"); return; } for(int i=0;i<Students.size();i++) { Student s = Students.get(i); System.out.println("学号:"+s.getId()+"\n姓名:"+s.getName()+"\n性别:"+s.getSex()+"\n年龄:"+s.getAge()+"\n成绩:"+s.getScore()); } } //----------------------------------------------单独查找----------------------------------------------- public static void singlefind(List<Student> students) { Scanner sc=new Scanner(System.in); System.out.println("请输入要查找的学号"); int findId=sc.nextInt(); int index = -1; for(int i=0;i<students.size();i++) { Student s = students.get(i); if(s.getId()==findId) { index=i; } if (index == -1) { System.out.println("你要查找的学生不存在,请重新选择!"); }else { System.out.println("学号:"+s.getId()+"\n姓名:"+s.getName()+"\n性别:"+s.getSex()+"\n年龄:"+s.getAge()+"\n成绩:"+s.getScore()); } } } //------------------------------------------------------------------------------------------------删除 public static void deletestudent(List<Student> Students) { Scanner sc= new Scanner(System.in); System.out.print("请输入要删除的学号:"); int deleId = sc.nextInt(); int index = -1; for(int i=0;i<Students.size();i++) { Student s = Students.get(i); if(s.getId()==deleId) { index=i; } if (index == -1) { System.out.println("你要删除的学生不存在,请重新选择!"); } else { Students.remove(index); System.out.println("删除学生成功!!"); } } } //---------------------------------------------------------------------------------------修改 public static void changestudent(List<Student> students) { Scanner sc= new Scanner(System.in); System.out.print("请输入要改变的学号:"); int changeId = sc.nextInt(); int index = -1; for(int i=0;i<students.size();i++) { Student s = students.get(i); if(s.getId()==changeId) { index = i; } } if (index == -1) { System.out.println("您要改变的学生不存在,请重新操作!"); } else { System.out.println("请输入新的姓名:"); String name = sc.nextLine(); System.out.println("请输入新的年龄:"); int age = sc.nextInt(); System.out.println("请输入新的性别:"); String sex = sc.nextLine(); System.out.println("请输入新的成绩:"); int score = sc.nextInt(); //创建学生对象 Student s = new Student(); s.setId(changeId); s.setName(name); s.setAge(age); s.setSex(sex); s.setScore(score); //修改学生对象 students.set(index,s); System.out.println("修改学生成功!!!"); } } } //学生类 package xuejiguanli; public class Student { private String name; private int Id; private int age; private String sex; private int score; public Student() { } public Student(String name, int Id, int age, String sex,int score) { super(); this.name = name; this.Id = Id; this.age = age; this.sex = sex; this.score =score; } public String getName() { return name; }//姓名 public int getId() { return Id; }//学号 public int getAge() { return age; }//年龄 public String getSex() { return sex; }//性别 public int getScore() { return score; }//成绩 public void setName(String name) { this.name = name; } public void setId(int Id) { this.Id = Id; } public void setAge(int age) { this.age = age; } public void setSex(String sex) { this.sex = sex; } public void setScore(int score) { this.score = score; } }
Development Value 开发值的问题
Problem Description StarCraft 2 (SC2) is a famous game. More and more people fall in love with this game. As a crazy fan of SC2, Ahua (flower fairy) play it day and night. Recently, he found that the most important part of being a top player of SC2 is economic development, which means you should get as much mine as possible by training SCVs (space construction vehicle) to collect mine. Train a SCV at ith second costs Ci units of mine. After training, this SCV can collect Di units of mine each second. Training a SCV needs one second of time. Based on that, he composes a formula to evaluate the development in a time span from xth second to yth second. Assume at xth second, Ahua has no SCV and mine. He trains one SCV at each second during xth second and yth second (the mount of mine can be negative, so that he always can train SCV). Each SCV will collect some amount of mines for Ahua in each second after it was trained. At ith second Ahua has Mi units of mine in total. The development value is defined as sum(Mi) (x ≤ i ≤ y). Now he asks you to help him calculate the development value. To make it more interesting, Ahua can apply following operations: Cost x y z: the cost of training a SCV between xth second to yth second will increase by z units of mine. i.e. Ci for x ≤ i ≤ y will increase by z. Collect x y z: each SCV trained between xth second and yth second can collect z more mines every second after it has been trained. i.e. Di for x ≤ i ≤ y will increase by z. Query x y: output the development value between xth second and yth second. Input First line of the input is a single integer T (T ≤ 10), indicates there are T test cases. For each test case, the first line is an integer N (1 ≤ N ≤ 100000), means the maximum time you should deal with. Following N lines, each contain two integers Ci and Di (0 ≤ Ci, Di ≤ 100000), the cost and collect speed of SCV training in ith second initially as described above. The next line is an integer Q (1 ≤ Q ≤ 10000), the number of operations you should deal with. Then Q lines followed, each line will be “Cost x y z”, "Collect x y z” or “Query x y”. 1 ≤ x ≤ y ≤ N, 0 ≤ z ≤ 100000 Output For each test case, first output “Case k: “ in a single line, k is the number of the test case, from 1 to T. Then for each "Q x y", you should output a single line contains the answer mod 20110911. Sample Input 1 5 1 3 2 3 3 1 2 2 3 3 5 Query 1 3 Cost 2 2 1 Query 1 3 Collect 1 1 5 Query 1 3 Sample Output Case 1: 2 0 15
请求大佬支援!!!报错java.lang.StackOverflowError
![图片说明](https://img-ask.csdn.net/upload/201911/25/1574663248_734186.jpg) ``` package org.bwgl.Fibonacci; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { long n = sc.nextLong(); long m = sc.nextLong(); long p = sc.nextLong(); long num1 = test1(n);//递归求和 long num2 = test2(m);//求前m项 long x = (num1%num2)%p; System.out.println(x); } } public static long test1(long n) {//前n项和 if(n==1) return 1; else if(n==2) return 2; else if(n>2) return test1(n-1)+test2(n); return 0; } public static long test2(long n) {//求前m项 if(n==1||n==2) { return 1; }else { return test2(n-1)+test2(n-2); } } } ```
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Linux(服务器编程):15---两种高效的事件处理模式(reactor模式、proactor模式)
前言 同步I/O模型通常用于实现Reactor模式 异步I/O模型则用于实现Proactor模式 最后我们会使用同步I/O方式模拟出Proactor模式 一、Reactor模式 Reactor模式特点 它要求主线程(I/O处理单元)只负责监听文件描述符上是否有事件发生,有的话就立即将时间通知工作线程(逻辑单元)。除此之外,主线程不做任何其他实质性的工作 读写数据,接受新的连接,以及处...
阿里面试官问我:如何设计秒杀系统?我的回答让他比起大拇指
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图和个人联系方式,欢迎Star和指教 前言 Redis在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在Redis的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了...
五年程序员记流水账式的自白。
不知觉已中码龄已突破五年,一路走来从起初铁憨憨到现在的十九线程序员,一路成长,虽然不能成为高工,但是也能挡下一面,从15年很火的android开始入坑,走过java、.Net、QT,目前仍处于android和.net交替开发中。 毕业到现在一共就职过两家公司,目前是第二家,公司算是半个创业公司,所以基本上都会身兼多职。比如不光要写代码,还要写软著、软著评测、线上线下客户对接需求收集...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n
一文详尽系列之模型评估指标
点击上方“Datawhale”,选择“星标”公众号第一时间获取价值内容在机器学习领域通常会根据实际的业务场景拟定相应的不同的业务指标,针对不同机器学习问题如回归、分类、排...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
压测学习总结(1)——高并发性能指标:QPS、TPS、RT、吞吐量详解
一、QPS,每秒查询 QPS:Queries Per Second意思是“每秒查询率”,是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。互联网中,作为域名系统服务器的机器的性能经常用每秒查询率来衡量。 二、TPS,每秒事务 TPS:是TransactionsPerSecond的缩写,也就是事务数/秒。它是软件测试结果的测量单位。一个事务是指一...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆  每天早上8:30推送 作者| Mr.K   编辑| Emma 来源| 技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯
程序员该看的几部电影
##1、骇客帝国(1999) 概念:在线/离线,递归,循环,矩阵等 剧情简介: 不久的将来,网络黑客尼奥对这个看似正常的现实世界产生了怀疑。 他结识了黑客崔妮蒂,并见到了黑客组织的首领墨菲斯。 墨菲斯告诉他,现实世界其实是由一个名叫“母体”的计算机人工智能系统控制,人们就像他们饲养的动物,没有自由和思想,而尼奥就是能够拯救人类的救世主。 可是,救赎之路从来都不会一帆风顺,到底哪里才是真实的世界?
Python绘图,圣诞树,花,爱心 | Turtle篇
每周每日,分享Python实战代码,入门资料,进阶资料,基础语法,爬虫,数据分析,web网站,机器学习,深度学习等等。 公众号回复【进群】沟通交流吧,QQ扫码进群学习吧 微信群 QQ群 1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle()...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
还记得那个提速8倍的IDEA插件吗?VS Code版本也发布啦!!
去年,阿里云发布了本地 IDE 插件 Cloud Toolkit,仅 IntelliJ IDEA 一个平台,就有 15 万以上的开发者进行了下载,体验了一键部署带来的开发便利。时隔一年的今天,阿里云正式发布了 Visual Studio Code 版本,全面覆盖前端开发者,帮助前端实现一键打包部署,让开发提速 8 倍。 VSCode 版本的插件,目前能做到什么? 安装插件之后,开发者可以立即体验...
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布了 2019年国民经济报告 ,报告中指出:年末中国大陆总人口(包括31个
2019年除夕夜的有感而发
天气:小雨(加小雪) 温度:3摄氏度 空气:严重污染(399) 风向:北风 风力:微风 现在是除夕夜晚上十点钟,再有两个小时就要新的一年了; 首先要说的是我没患病,至少现在是没有患病;但是心情确像患了病一样沉重; 现在这个时刻应该大部分家庭都在看春晚吧,或许一家人团团圆圆的坐在一起,或许因为某些特殊原因而不能团圆;但不管是身在何处,身处什么境地,我都想对每一个人说一句:新年快乐! 不知道csdn这...
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o...
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
2020年的1月,我辞掉了我的第一份工作
其实,这篇文章,我应该早点写的,毕竟现在已经2月份了。不过一些其它原因,或者是我的惰性、还有一些迷茫的念头,让自己迟迟没有试着写一点东西,记录下,或者说是总结下自己前3年的工作上的经历、学习的过程。 我自己知道的,在写自己的博客方面,我的文笔很一般,非技术类的文章不想去写;另外我又是一个还比较热衷于技术的人,而平常复杂一点的东西,如果想写文章写的清楚点,是需要足够...
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
节后首个工作日,企业们集体开晨会让钉钉挂了
By 超神经场景描述:昨天 2 月 3 日,是大部分城市号召远程工作的第一天,全国有接近 2 亿人在家开始远程办公,钉钉上也有超过 1000 万家企业活跃起来。关键词:十一出行 人脸...
Java基础知识点梳理
Java基础知识点梳理 摘要: 虽然已经在实际工作中经常与java打交道,但是一直没系统地对java这门语言进行梳理和总结,掌握的知识也比较零散。恰好利用这段时间重新认识下java,并对一些常见的语法和知识点做个总结与回顾,一方面为了加深印象,方便后面查阅,一方面为了学好java打下基础。 Java简介 java语言于1995年正式推出,最开始被命名为Oak语言,由James Gosling(詹姆
2020年全新Java学习路线图,含配套视频,学完即为中级Java程序员!!
新的一年来临,突如其来的疫情打破了平静的生活! 在家的你是否很无聊,如果无聊就来学习吧! 世上只有一种投资只赚不赔,那就是学习!!! 传智播客于2020年升级了Java学习线路图,硬核升级,免费放送! 学完你就是中级程序员,能更快一步找到工作! 一、Java基础 JavaSE基础是Java中级程序员的起点,是帮助你从小白到懂得编程的必经之路。 在Java基础板块中有6个子模块的学
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
相关热词 c# 识别回车 c#生成条形码ean13 c#子控制器调用父控制器 c# 写大文件 c# 浏览pdf c#获取桌面图标的句柄 c# list反射 c# 句柄 进程 c# 倒计时 线程 c# 窗体背景色
立即提问