码迷,mamicode.com
首页 >  
搜索关键字:while if else    ( 50281个结果
07 Spark RDD编程 综合实例 英文词频统计
>>> s = txt.lower().split()>>> dd = {}>>> for word in s:... if word not in dd:... dd[word] = 1... else:... dd[word] = dic[word] + 1...>>> ss = sorted( ...
分类:其他好文   时间:2021-04-23 12:18:32    阅读次数:0
07 Spark RDD编程 综合实例 英文词频统计
1. 用Pyspark自主实现词频统计过程。 >>> s = txt.lower().split()>>> dd = {}>>> for word in s:... if word not in dd:... dd[word] = 1... else:... dd[word] = dic[word] ...
分类:其他好文   时间:2021-04-23 12:10:50    阅读次数:0
【Java笔试】输入输出模板
笔试算法题中,有时候是要自己处理输入,比如从键盘中接收一个数,整理了一些常用的,真正笔试之前可以看一看。 输入 循环输入: Scanner sc = new Scanner(System.in); while (sc.hasNextLine()){ String s = sc.nextLine(); ...
分类:编程语言   时间:2021-04-23 12:06:51    阅读次数:0
linux shell while循环
1、测试1 [root@centos7 test2]# i=0 [root@centos7 test2]# max=5 [root@centos7 test2]# while((i<max));do echo $i;((i++));done 0 1 2 3 4 ...
分类:系统相关   时间:2021-04-23 12:03:54    阅读次数:0
L1-063 吃鱼还是吃肉 (10 分)
水题。 int h[]={129,130}; int w[]={25,27}; int main() { int T; cin>>T; while(T--) { int sex,height,weight; cin>>sex>>height>>weight; vector<string> res; ...
分类:其他好文   时间:2021-04-23 11:57:55    阅读次数:0
linux shell if语句
1、测试1 [root@centos7 test2]# ls a.txt [root@centos7 test2]# if [ -e a.txt ]; then echo "exist";else echo "no nxist"; fi exist [root@centos7 test2]# if ...
分类:系统相关   时间:2021-04-23 11:53:02    阅读次数:0
k_means聚类算法
这是老师上课布置的一道算法题 刚开始理解还是有些困难的 查阅一些大佬的博客做出如下理解: 1.首先你要先确定你要对相关数据分成几类(或者说是几组) —— 先假定为k 2.再从这些数据中选出 k 个数据(成员)为组长(centroid) —— 为便于理解,下面把数据看成成员 可以随机选择,也可以指定第 ...
分类:编程语言   时间:2021-04-23 11:52:16    阅读次数:0
中文繁体简体问题
1.可以把一段文字中的繁体字全部自动转化为简体字` $in="繁体繁體"; $in=iconv('UTF-8','BIG5//TRANSLIT',$in); $in=iconv('BIG5','GB2312//TRANSLIT',$in); $out=iconv('GB2312','UTF-8//T ...
分类:其他好文   时间:2021-04-22 16:34:19    阅读次数:0
linux shell脚本中流程控制语句 if 、for、while、case
linux shell脚本中流程控制语句 if、for、while、case 1、if语句 [root@centos7 test2]# ls test.sh [root@centos7 test2]# pwd /home/test2 [root@centos7 test2]# cat test.sh ...
分类:系统相关   时间:2021-04-22 16:20:40    阅读次数:0
while 循环初认识
#!/usr/bin/env python #-*- coding:utf-8 -*- num=0 while num<=10: print(num,end="\t") num +=1 print("**************************") num2=0 sum_all=0 whil ...
分类:其他好文   时间:2021-04-22 16:16:24    阅读次数:0
50281条   上一页 1 ... 29 30 31 32 33 ... 5029 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!